/* Reset and Base Styles */
* {
    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: #EDEEF7;
    background-image: 
        radial-gradient(circle at 25% 25%, #B8B5FF 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, #E4FBFF 0%, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Paper Texture Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.1) 2px,
            rgba(255, 255, 255, 0.1) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.1) 2px,
            rgba(255, 255, 255, 0.1) 4px
        );
    pointer-events: none;
    z-index: -1;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 30px rgba(120, 104, 230, 0.1);
    min-height: 100vh;
    backdrop-filter: blur(10px);
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #7868E6, #B8B5FF);
    color: white;
    padding: 2rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.header-content {
    position: relative;
    z-index: 2;
}

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

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

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    position: relative;
    z-index: 2;
}

.nav-tab {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 1rem 2rem;
    margin: 0 0.25rem;
    cursor: pointer;
    border-radius: 25px 25px 0 0;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nav-tab.active {
    background: rgba(255, 255, 255, 0.95);
    color: #7868E6;
    font-weight: bold;
}

/* Main Content */
.main-content {
    padding: 2rem;
    min-height: 60vh;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    color: #7868E6;
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.1rem;
    color: #666;
}

/* Age Calculator */
.age-calculator {
    background: rgba(232, 239, 255, 0.7);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 3rem;
    box-shadow: 0 5px 15px rgba(120, 104, 230, 0.1);
}

.age-calculator h3 {
    color: #7868E6;
    margin-bottom: 1.5rem;
    text-align: center;
}

.calculator-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #7868E6;
}

.form-group input {
    padding: 0.75rem;
    border: 2px solid #B8B5FF;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #7868E6;
    box-shadow: 0 0 0 3px rgba(120, 104, 230, 0.1);
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #7868E6, #B8B5FF);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(120, 104, 230, 0.3);
}

.btn-secondary {
    background: #E4FBFF;
    color: #7868E6;
    border: 2px solid #B8B5FF;
}

.btn-secondary:hover {
    background: #B8B5FF;
    color: white;
}

/* Recommendation Result */
.recommendation-result {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    border-left: 5px solid #7868E6;
    display: none;
}

.recommendation-result.show {
    display: block;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.recommendation-result h4 {
    color: #7868E6;
    margin-bottom: 1rem;
}

/* Car Seats Grid */
.car-seats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.car-seat-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

.car-seat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(120, 104, 230, 0.2);
    border-color: #B8B5FF;
}

.card-image {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.seat-icon {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.infant-seat {
    background: linear-gradient(135deg, #FFB4B4, #ff9999);
}

.convertible-seat {
    background: linear-gradient(135deg, #B8B5FF, #9999ff);
}

.booster-seat {
    background: linear-gradient(135deg, #E4FBFF, #99e6ff);
}

.booster-back-seat {
    background: linear-gradient(135deg, #EDEEF7, #d9d9f7);
}

.seat-icon::before {
    content: '🚗';
    font-size: 2rem;
}

.car-seat-card h3 {
    color: #7868E6;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.age-range, .weight-range {
    background: #f0f0f0;
    padding: 0.5rem;
    border-radius: 20px;
    font-size: 0.9rem;
    margin: 0.5rem 0;
    font-weight: 500;
}

.age-range {
    color: #7868E6;
}

.weight-range {
    color: #666;
}

/* Installation Method Selector */
.installation-method-selector {
    text-align: center;
    margin-bottom: 2rem;
}

.method-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.method-btn {
    padding: 1rem 2rem;
    border: 2px solid #B8B5FF;
    background: white;
    color: #7868E6;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.method-btn.active,
.method-btn:hover {
    background: #7868E6;
    color: white;
}

/* Video Guides */
.video-guides-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

#video-player-container {
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

#installation-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(120, 104, 230, 0.1);
    color: #7868E6;
}

.play-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #7868E6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    cursor: pointer;
}

.play-icon::before {
    content: '▶';
    color: white;
    font-size: 1.5rem;
    margin-left: 3px;
}

.video-list {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    height: fit-content;
}

.video-list h4 {
    color: #7868E6;
    margin-bottom: 1rem;
}

.video-item {
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-item:hover {
    background: #f8f9ff;
    border-color: #B8B5FF;
}

.video-item.active {
    background: #B8B5FF;
    color: white;
}

/* Installation Steps */
.installation-steps {
    background: white;
    border-radius: 15px;
    padding: 2rem;
}

.installation-steps h3 {
    color: #7868E6;
    margin-bottom: 1.5rem;
}

.step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.step-number {
    background: #7868E6;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 1rem;
    flex-shrink: 0;
}

.step-content h4 {
    color: #7868E6;
    margin-bottom: 0.5rem;
}

/* Safety Checklist */
.safety-checklist {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.checklist-header {
    text-align: center;
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #eee;
    border-radius: 5px;
    margin: 1rem 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7868E6, #B8B5FF);
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    font-weight: bold;
    color: #7868E6;
}

.checklist-category {
    margin-bottom: 2rem;
}

.checklist-category h4 {
    color: #7868E6;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9ff;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.checklist-item input[type="checkbox"] {
    margin-right: 1rem;
    margin-top: 0.2rem;
    transform: scale(1.2);
    accent-color: #7868E6;
}

.checklist-item label {
    cursor: pointer;
    line-height: 1.5;
}

.checklist-item:has(input:checked) {
    background: #e8f5e8;
    border-left: 4px solid #4CAF50;
}

.safety-result {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    display: none;
}

.safety-result.show {
    display: block;
}

.safety-result.excellent {
    background: #e8f5e8;
    border: 2px solid #4CAF50;
    color: #2e7d32;
}

.safety-result.good {
    background: #fff3e0;
    border: 2px solid #ff9800;
    color: #e65100;
}

.safety-result.needs-improvement {
    background: #ffebee;
    border: 2px solid #f44336;
    color: #c62828;
}

/* Safety Tips */
.safety-tips {
    margin-top: 3rem;
}

.safety-tips h3 {
    color: #7868E6;
    margin-bottom: 2rem;
    text-align: center;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.tip-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.tip-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.tip-icon.warning {
    background: #FFB4B4;
}

.tip-icon.temperature {
    background: #E4FBFF;
}

.tip-icon.maintenance {
    background: #B8B5FF;
}

.tip-icon::before {
    content: '⚠️';
}

.tip-icon.temperature::before {
    content: '🌡️';
}

.tip-icon.maintenance::before {
    content: '🔧';
}

.tip-card h4 {
    color: #7868E6;
    margin-bottom: 1rem;
}

/* Recall Search */
.recall-search {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.recall-search h3 {
    color: #7868E6;
    margin-bottom: 1.5rem;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

/* Recalls List */
.recalls-list {
    margin-bottom: 3rem;
}

.recalls-list h3 {
    color: #7868E6;
    margin-bottom: 1.5rem;
}

.recall-item {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #FFB4B4;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.recall-item.high-priority {
    border-left-color: #f44336;
    background: #ffebee;
}

.recall-item h4 {
    color: #d32f2f;
    margin-bottom: 0.5rem;
}

.recall-date {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

/* Recall Subscription */
.recall-subscription {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.recall-subscription h3 {
    color: #7868E6;
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Registered Seats */
.registered-seats {
    background: white;
    border-radius: 15px;
    padding: 2rem;
}

.registered-seats h3 {
    color: #7868E6;
    margin-bottom: 1.5rem;
}

.registered-seat-item {
    background: #f8f9ff;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.seat-info h4 {
    color: #7868E6;
    margin-bottom: 0.25rem;
}

.seat-info p {
    font-size: 0.9rem;
    color: #666;
}

.remove-seat {
    background: #FFB4B4;
    color: #d32f2f;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.remove-seat:hover {
    background: #f44336;
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.close:hover {
    color: #7868E6;
}

/* Footer */
.footer {
    background: #7868E6;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        margin: 0;
        border-radius: 0;
    }

    .header h1 {
        font-size: 2rem;
    }

    .nav-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .main-content {
        padding: 1rem;
    }

    .calculator-form,
    .search-form {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .video-guides-container {
        grid-template-columns: 1fr;
    }

    .car-seats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1.5rem 1rem;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .nav-tabs {
        margin-top: 1rem;
    }

    .nav-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .car-seat-card {
        padding: 1rem;
    }

    .seat-icon {
        width: 60px;
        height: 60px;
    }

    .seat-icon::before {
        font-size: 1.5rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

.hidden { display: none; }
.visible { display: block; }

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(120, 104, 230, 0.3);
    border-radius: 50%;
    border-top-color: #7868E6;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error Messages */
.message {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    display: none;
}

.message.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

.message.success {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4CAF50;
}

.message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

.message.warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ff9800;
}

/* Form Validation */
.form-group input.invalid {
    border-color: #f44336;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

.form-group input.valid {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.error-message {
    color: #f44336;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.error-message.show {
    display: block;
}
