/* Base styles for Garmin Intervals Sharer */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    padding: 40px 20px;
    color: white;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Main content card */
.main-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Flash messages */
#flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.flash-message {
    background: #4CAF50;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.flash-message.flash-error {
    background: #f44336;
}

.flash-message.flash-warning {
    background: #ff9800;
}

.flash-message.flash-info {
    background: #2196F3;
}

.flash-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    margin-left: 15px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flash-close:hover {
    opacity: 0.7;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Auto-hide flash messages after 5 seconds */
.flash-message {
    animation: slideIn 0.3s ease-out, fadeOut 0.5s ease-out 4.5s forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Center action buttons */
.action-buttons.center {
    justify-content: center;
}

/* Form elements */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.required {
    color: #e74c3c;
}

/* Duration summary fields */
.duration-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e1e5e9;
}

.duration-field {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.duration-field label {
    font-size: 12px;
    font-weight: 500;
    color: #6c757d;
    margin-bottom: 5px;
    text-align: center;
}

.duration-display {
    width: 60px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    font-weight: 600;
    text-align: center;
    background: #e9ecef !important;
    color: #495057 !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    cursor: default;
}

.duration-display:focus {
    box-shadow: none !important;
    border-color: #dee2e6 !important;
}

@media (max-width: 768px) {
    .duration-summary {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .duration-field {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .duration-field label {
        margin-bottom: 0;
        text-align: left;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 15px 30px;
    margin: 10px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #5a67d8;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.btn.copy { background: #28a745; }
.btn.copy:hover { background: #218838; }
.btn.test { background: #17a2b8; }
.btn.test:hover { background: #138496; }
.btn.clear { background: #6c757d; }
.btn.clear:hover { background: #5a6268; }

.action-buttons {
    text-align: center;
    margin-top: 30px;
}

/* Help sections */
.format-help {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    border-left: 4px solid #667eea;
}

.format-help h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.format-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.format-example {
    background: white;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.format-example code {
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #667eea;
}

/* Quick examples */
.quick-examples {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
}

.quick-examples h3 {
    color: #495057;
    margin-bottom: 15px;
    text-align: center;
}

.example-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.button-group {
    background: rgba(108, 117, 125, 0.08);
    border: 1px solid rgba(108, 117, 125, 0.15);
    border-radius: 12px;
    padding: 15px;
    margin: 8px 0;
}

.button-group.work-buttons {
    background: rgba(40, 167, 69, 0.08);
    border-color: rgba(40, 167, 69, 0.15);
}

.button-group.recovery-buttons {
    background: rgba(23, 162, 184, 0.08);
    border-color: rgba(23, 162, 184, 0.15);
}

.button-group.utility-buttons {
    background: rgba(108, 117, 125, 0.08);
    border-color: rgba(108, 117, 125, 0.15);
}

.example-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.example-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Results and previews */
.result {
    background: white;
    padding: 25px;
    margin: 20px 0;
    border-radius: 15px;
    border: 1px solid #dee2e6;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.url-display {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    margin: 15px 0;
    border: 1px solid #dee2e6;
    font-size: 14px;
}

.url-display a {
    color: #007cba;
    text-decoration: none;
    font-weight: bold;
}

.url-display a:hover {
    color: #005a8a;
    text-decoration: underline;
}

.preview {
    background: #e8f5e8;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #c3e6cb;
    margin: 20px 0;
}

.preview h3 {
    color: #155724;
    margin-bottom: 15px;
}

.qr-section {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    margin: 15px 0;
}

/* Footer */
.footer {
    margin-top: 50px;
}

.quick-links {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    margin: 30px 0;
}

.quick-links a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    padding: 10px 20px;
    border: 2px solid white;
    border-radius: 25px;
    display: inline-block;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.quick-links a:hover {
    background: white;
    color: #667eea;
}

/* Info boxes */
.info {
    background-color: #f0f8ff;
    padding: 15px;
    border-left: 4px solid #007cba;
    margin: 15px 0;
    border-radius: 4px;
}

.success {
    background-color: #f0fff0;
    padding: 15px;
    border-left: 4px solid #28a745;
    margin: 15px 0;
    border-radius: 4px;
}

.warning {
    background-color: #fff3cd;
    padding: 15px;
    border-left: 4px solid #ffc107;
    margin: 15px 0;
    border-radius: 4px;
}

.error {
    color: red;
    margin: 10px 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .main-card {
        padding: 20px;
        margin: 20px 10px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .format-examples {
        grid-template-columns: 1fr;
    }
    
    .example-buttons {
        justify-content: flex-start;
    }
}
