/**
 * Drive Time Tracker - Global Styles
 * Mobile-first responsive design
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
}

/* Centered layout for login page */
body.centered {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Full-width layout for main app */
body.app {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

/* Login Container */
.login-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    padding: 40px 30px;
}

h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    color: #666;
    font-size: 14px;
    text-align: center;
    margin-bottom: 30px;
}

/* Error Messages */
.error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    color: #333;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
}

/* Button Styles */
button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 44px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

/* Footer */
.footer {
    margin-top: 30px;
    text-align: center;
    color: #999;
    font-size: 12px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .login-container {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 24px;
    }
}

/* Main Interface Styles */
.main-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 600px;
    min-width: 320px;
    padding: 0;
    overflow: hidden;
    margin: 0 auto;
}

.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.app-header h1 {
    color: white;
    margin-bottom: 10px;
}

.user-info {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.logout-link {
    color: white;
    text-decoration: underline;
    margin-left: 10px;
}

.logout-link:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Success Messages */
.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px;
    border-radius: 6px;
    margin: 20px;
    font-size: 14px;
}

/* Stopwatch Container */
.stopwatch-container {
    padding: 30px 20px;
}

.timer-display {
    font-size: 72px;
    font-weight: bold;
    text-align: center;
    color: #667eea;
    margin: 30px 0;
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 44px;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-start {
    background: #28a745;
    color: white;
}

.btn-start:not(:disabled):hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.btn-stop {
    background: #dc3545;
    color: white;
}

.btn-stop:not(:disabled):hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

.btn-view {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-view:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* Note Container */
.note-container {
    margin-bottom: 30px;
}

.note-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.note-field {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

.note-field:focus {
    outline: none;
    border-color: #667eea;
}

.note-field:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1000;
    max-width: 90%;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

.toast-success {
    background: #28a745;
}

.toast-error {
    background: #dc3545;
}

/* Mobile Adjustments for Main Interface */
@media (max-width: 480px) {
    .timer-display {
        font-size: 56px;
    }
    
    .btn {
        font-size: 16px;
        padding: 14px;
    }
    
    .stopwatch-container {
        padding: 20px 15px;
    }
}
