/* Custom styles - Enhanced Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #0d0d0d;
    color: #e5e7eb;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Typography Hierarchy */
.header-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 2px 2px 20px rgba(255, 255, 255, 0.15);
}

.section-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.section-subtitle {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    letter-spacing: -0.005em;
}

.body-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: -0.005em;
}

.description-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    line-height: 1.6;
    font-style: italic;
    opacity: 0.9;
}
.card {
    background-color: #1c1c1c;
    border: 1px solid #2f2f2f;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(255, 255, 255, 0.05), 0 4px 6px -2px rgba(255, 255, 255, 0.05);
}
.card-content {
    flex-grow: 1;
}
.card-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.card-description {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: -0.005em;
}
.card-icon {
    background-color: #2f2f2f;
    color: #ffffff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    border: 2px solid #4a4a4a;
}
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 0.5rem;
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.spinner {
    border-top-color: #ffffff;
    animation: spin 1s linear infinite;
}
#analysis-result h3 {
    font-size: 1.25rem; /* 20px */
    font-weight: 700;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
#analysis-result strong {
    color: #ffffff;
}
.accent-color {
    color: #ffffff;
}
.button-primary {
    background-color: #e5e7eb;
    color: #0d0d0d;
}
.button-primary:hover {
    background-color: #ffffff;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
}

/* iPhone specific fixes */
@media screen and (max-width: 414px) {
    /* iPhone 12 mini and similar */
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100vw !important;
        width: 100% !important;
    }
    
    /* Ensure grids don't overflow */
    .grid {
        gap: 0.75rem !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Fix card spacing */
    .card {
        margin: 0 !important;
        padding: 0.75rem !important;
    }
    
    /* Reduce text padding */
    .px-2 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    /* Improve touch targets */
    button {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    /* Better text sizing on mobile */
    .card-title {
        font-size: 1.1rem;
        line-height: 1.4;
    }
    
    .card-description {
        font-size: 0.875rem;
        line-height: 1.5;
    }
    
    /* Optimize form elements */
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    /* Better spacing for cards */
    .card {
        padding: 1rem;
    }
    
    /* Optimize disclaimer for mobile */
    #ai-disclaimer {
        padding: 12px;
        margin-top: 12px;
    }
    
    #ai-disclaimer .flex {
        flex-direction: column;
        gap: 8px;
    }
    
    #ai-disclaimer .flex-shrink-0 {
        align-self: flex-start;
    }
    
    /* Better modal sizing */
    #video-modal .bg-\[#1c1c1c\] {
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Improve loading indicator */
    #loading-indicator {
        padding: 1.5rem;
    }
    
    /* Better footer spacing */
    footer {
        margin-top: 2rem;
        padding: 1rem;
    }
    
    /* Fix potential overflow issues */
    .container {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Ensure cards don't overflow */
    .card {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Fix grid overflow */
    .grid {
        width: 100%;
        max-width: 100%;
    }
    
    /* Ensure text doesn't cause overflow */
    h1, h2, h3, h4, p {
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
    /* Fix any wide elements */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
}