/*
Copyright (c) 2025 Roy Moss / Where the Wild Chats Are
All rights reserved.

Custom styling for conversation guide platform
Proprietary design system and user experience elements
*/

/* Modern & Fun Picture Book Conversation Tool */

:root {
    --primary-gradient: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    --success-gradient: linear-gradient(135deg, #5cb85c 0%, #449d44 100%);
    --warning-gradient: linear-gradient(135deg, #f0ad4e 0%, #ec971f 100%);
    --info-gradient: linear-gradient(135deg, #5bc0de 0%, #46b8da 100%);
    --fun-purple: #6c757d;
    --fun-pink: #d9534f;
    --fun-orange: #f0ad4e;
    --fun-teal: #5bc0de;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --text-dark: #212529;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
}

/* Modern Brand Typography */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-dark);
    letter-spacing: -0.01em;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.display-4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.03em;
}

/* Enhanced Brand Elements */
.navbar-brand {
    font-family: 'Comfortaa', sans-serif !important;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(44, 90, 160, 0.1);
}

.btn {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    letter-spacing: -0.01em;
    border-radius: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.3);
}

    box-shadow: 0 8px 25px 0 rgba(37, 99, 235, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 14px 0 rgba(245, 158, 11, 0.3);
}

    box-shadow: 0 8px 25px 0 rgba(245, 158, 11, 0.4);
    color: white;
}

/* Ensure proper text contrast */
.text-muted {
    color: var(--text-muted) !important;
}

.card-body {
    color: var(--text-dark);
}

.form-text {
    color: var(--text-muted) !important;
}

/* Language-specific font adjustments */
[lang="zh"], [lang="ja"] {
    font-family: 'Noto Sans CJK SC', 'Noto Sans', sans-serif;
}

[lang="ar"] {
    font-family: 'Noto Sans Arabic', 'Noto Sans', sans-serif;
    direction: rtl;
}

[lang="hi"] {
    font-family: 'Noto Sans Devanagari', 'Noto Sans', sans-serif;
}

/* Layout improvements */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Simple card styling */
.card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
}

.card-header {
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0 !important;
    background: #f8f9fa;
    color: #212529;
    font-weight: 600;
    padding: 1rem;
}

/* Fun gradient headers */
.card-header.bg-primary {
    background: var(--primary-gradient) !important;
}

.card-header.bg-success {
    background: var(--success-gradient) !important;
}

.card-header.bg-info {
    background: var(--info-gradient) !important;
}

.card-header.bg-warning {
    background: var(--warning-gradient) !important;
    color: white !important;
}

.card-header.bg-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
}

/* Fun conversation starters */
.conversation-starter {
    border-radius: 8px;
    border: none;
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
    padding: 1rem;
}

/* Modern book recommendations */
.book-recommendation {
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

/* Simple button styling */
.btn {
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem;
}

.btn-primary {
    background: #007bff;
    border: 1px solid #007bff;
}

.btn-lg {
    padding: 1rem 3rem;
    font-size: 1.1rem;
}

/* Simple navbar */

/* Simple form styling */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 0.5rem 0.75rem;
}

/* Container improvements */
main .container {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 3rem 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Fun badges */
.badge {
    border-radius: 25px;
    font-weight: 500;
}

/* Improved alerts */
.alert {
    border-radius: 15px;
    border: none;
}

/* Monetization elements */
.ad-space {
    background-color: var(--bs-light);
    border: 2px dashed var(--bs-secondary);
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ===== AD PLACEMENT OPTIMIZATION ===== */
@media (max-width: 991.98px) {
    /* Hide desktop sidebar ads on mobile/tablet for clean experience */
    .d-none.d-lg-block {
        display: none !important;
    }
    
    /* Optimize native ads for mobile */
    #adsense-native-content .col-md-2:first-child,
    #adsense-native-content .col-md-2:last-child {
        display: none;
    }
    
    #adsense-native-content .col-md-8 {
        text-align: center;
    }
}

/* Sticky sidebar ads behavior */
.sticky-top {
    transition: all 0.3s ease;
}

/* Ad visual enhancements */
[id^="adsense-"] {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Top banner ad optimization */
[id*="banner"] {
    min-height: 60px;
}

@media (max-width: 767.98px) {
    /* Make top banner more compact on mobile */
    [id*="banner"] h6 {
        font-size: 0.9rem;
    }
    
    [id*="banner"] small {
        font-size: 0.75rem;
    }
}

/* Print optimization - hide all ads when printing */
@media print {
    [id^="adsense-"],
    .card[class*="bg-gradient"],
    .card[style*="background: linear-gradient"],
    [class*="sponsored"],
    .container-fluid[style*="background: linear-gradient"] {
        display: none !important;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Print styles */
@media print {
    /* Hide navigation, buttons, and ads when printing */
    nav, .btn, .ad-space, .modal, .alert {
        display: none !important;
    }
    
    /* Ensure good print layout */
    .container {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .card-header {
        background-color: #f8f9fa !important;
        color: #212529 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Ensure conversation starters are readable */
    .conversation-starter {
        background-color: #f8f9fa !important;
        border-left: 4px solid #0d6efd !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        break-inside: avoid;
    }
    
    .book-recommendation {
        background-color: #f8f9fa !important;
        border-left: 3px solid #0dcaf0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Add page breaks where appropriate */
    .row {
        break-inside: avoid;
    }
    
    /* Print-specific header */
    body::before {
        content: "Picture Book Reading Guide - Generated by Where the Wild Chats Are";
        display: block;
        text-align: center;
        font-size: 0.8rem;
        color: #6c757d;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #dee2e6;
    }
}


/* Accessibility improvements */
.btn:focus, .form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Loading states */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
}

@keyframes spin {
}

/* Badge improvements */
.badge {
    font-weight: 500;
    letter-spacing: 0.025em;
}

/* Form enhancements */
.form-control:focus, .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Card header improvements */
.card-header {
    font-weight: 600;
}

/* Language switcher styling */
.dropdown-item.active {
    background-color: var(--bs-primary);
    color: var(--bs-white);
}

* {
                border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
