/*
 * BTN Mobile Overrides - v1.0
 * Mobile-only CSS optimizations for Become The Need platform
 * 
 * IMPORTANT: This file contains ONLY mobile breakpoint rules.
 * Desktop styling is NOT modified by this file.
 * 
 * Breakpoints:
 * - max-width: 768px (tablet/small screens)
 * - max-width: 480px (phones)
 */

/* ========================================
   TABLET BREAKPOINT (max-width: 768px)
   ======================================== */

@media (max-width: 768px) {
    
    /* ----------------------------------------
       NAVIGATION - All Pages
       ---------------------------------------- */
    .nav-glass {
        padding: 10px 15px;
    }
    
    .nav-content {
        gap: 10px;
    }
    
    .brand-container {
        gap: 8px;
    }
    
    .brand-logo {
        width: 32px;
        height: 32px;
    }
    
    .brand-name {
        font-size: 1.1rem;
    }
    
    .brand-tagline {
        font-size: 0.65rem;
        display: none;
    }
    
    .nav-actions {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    
    .btn-nav {
        padding: 6px 10px;
        font-size: 0.75rem;
        gap: 4px;
    }
    
    .btn-nav i {
        font-size: 0.85rem;
    }
    
    /* ----------------------------------------
       PAGE HEADERS - All Pages
       (Typography sizes removed - let pages control their own title sizes)
       ---------------------------------------- */
    .page-header {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .page-badge {
        font-size: 0.7rem;
        padding: 4px 10px;
    }
    
    /* ----------------------------------------
       MODALS - All Pages
       ---------------------------------------- */
    .modal-overlay {
        padding: 20px;
        align-items: center;
        justify-content: center;
        overflow-y: auto;
    }
    
    .modal-content {
        width: 90%;
        max-width: 90%;
        margin: 0 auto;
        max-height: 85vh;
        overflow-y: auto;
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .modal-header h2,
    .modal-header h3,
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
    
    /* ----------------------------------------
       STORY DECK - Bucket Grid
       ---------------------------------------- */
    .story-deck-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 10px;
    }
    
    .bucket-card {
        padding: 15px;
        min-height: 140px;
    }
    
    .bucket-title {
        font-size: 0.8rem;
    }
    
    .bucket-count {
        font-size: 0.75rem;
    }
    
    .filter-section {
        padding: 12px 15px;
        margin-bottom: 20px;
    }
    
    .filter-content {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .filter-dropdown {
        width: 100%;
    }
    
    .btn-start-new {
        width: 100%;
        justify-content: center;
    }
    
    .deck-meta {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }
    
    .progress-ring {
        width: 36px;
        height: 36px;
    }
    
    /* ----------------------------------------
       ANALYTICS PAGE
       ---------------------------------------- */
    .analytics-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .metrics-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .chart-container {
        padding: 15px;
        min-height: 250px;
    }
    
    .chart-container canvas {
        max-height: 220px;
    }
    
    .heatmap-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .heatmap-grid {
        min-width: 500px;
    }
    
    /* ----------------------------------------
       WINGSPAN PAGE - Badges
       ---------------------------------------- */
    .badges-section {
        padding: 15px;
    }
    
    .badges-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .badge-card-container {
        min-height: 160px;
    }
    
    .badge-card-inner {
        padding: 15px;
    }
    
    .badge-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .badge-name {
        font-size: 0.85rem;
    }
    
    .badge-description {
        font-size: 0.75rem;
    }
    
    .achievement-section {
        padding: 15px;
    }
    
    .flip-card {
        min-height: 180px;
    }
    
    .flip-card-front,
    .flip-card-back {
        padding: 15px;
    }
    
    /* ----------------------------------------
       MVP FLOW - Upload Forms (Portrait Mode Fix)
       ---------------------------------------- */
    .main-container {
        padding-top: 80px;
        min-height: auto;
    }
    
    .nav-glass {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .content-wrapper {
        padding: 15px;
    }
    
    .glass-card {
        padding: 20px 15px;
        border-radius: 16px;
        min-height: auto;
    }
    
    .form-grid,
    .glass-card .form-grid,
    .main-container .glass-card .form-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .glass-card form {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .form-section {
        padding: 15px;
        min-width: 0;
    }
    
    .section-title {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    
    textarea,
    input[type="text"],
    input[type="url"],
    input[type="file"] {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 12px;
    }
    
    textarea {
        min-height: 120px;
    }
    
    .upload-zone {
        padding: 25px 15px;
        min-height: 120px;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
    
    .upload-text {
        font-size: 0.9rem;
    }
    
    .btn-analyze {
        padding: 14px 25px;
        font-size: 1rem;
        width: 100%;
    }
    
    /* ----------------------------------------
       PRACTICE PAGE
       ---------------------------------------- */
    .practice-container {
        padding: 15px;
        max-width: 100%;
    }
    
    .practice-header {
        padding: 15px;
    }
    
    .practice-title {
        font-size: 1.2rem;
    }
    
    .story-display {
        padding: 15px;
        font-size: 0.9rem;
    }
    
    /* STAR Story Reference - Prevent endless scroll */
    .story-reference,
    .content-section .definition-text,
    #starStoryText {
        font-size: 0.95rem;
        line-height: 1.55;
        white-space: normal;
    }
    
    .content-section {
        padding: 20px 16px;
    }
    
    .recording-interface {
        padding: 20px 15px;
    }
    
    .recording-controls {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .record-btn {
        width: 70px;
        height: 70px;
    }
    
    .record-btn i {
        font-size: 1.8rem;
    }
    
    .recording-timer {
        font-size: 1.5rem;
    }
    
    .feedback-section {
        padding: 15px;
    }
    
    .feedback-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .average-score-badge {
        font-size: 0.9rem;
    }
    
    .feedback-scores {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .score-card {
        padding: 15px;
    }
    
    .score-name {
        font-size: 0.9rem;
    }
    
    .score-value {
        font-size: 1.5rem;
    }
    
    .score-advice {
        font-size: 0.8rem;
    }
    
    /* ----------------------------------------
       LANDING PAGE (Index)
       ---------------------------------------- */
    .hero-section {
        min-height: auto;
        align-items: flex-start;
        padding: 100px 15px 40px;
    }
    
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-cta {
        flex-direction: column;
        gap: 12px;
    }
    
    .hero-cta .btn-primary,
    .hero-cta .btn-secondary {
        width: 100%;
        padding: 14px 20px;
    }
    
    .hero-logo {
        width: 150px;
        height: 150px;
    }
    
    .hero-badge {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
    
    .features-section {
        padding: 40px 15px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-card {
        padding: 25px 20px;
    }
    
    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .feature-title {
        font-size: 1.1rem;
    }
    
    .feature-description {
        font-size: 0.9rem;
    }
    
    .journey-section {
        padding: 40px 15px;
    }
    
    .journey-step {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .testimonials-section {
        padding: 40px 15px;
    }
    
    .testimonial-card {
        padding: 20px;
    }
    
    /* ----------------------------------------
       RESULTS PAGE
       ---------------------------------------- */
    .results-container {
        padding: 15px;
    }
    
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .skill-card {
        padding: 15px;
        min-height: 120px;
    }
    
    .skill-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .skill-name {
        font-size: 0.85rem;
    }
    
    .skill-description {
        font-size: 0.75rem;
        display: none;
    }
    
    .summary-card {
        padding: 15px;
    }
    
    /* ----------------------------------------
       SKILL GALLERY
       ---------------------------------------- */
    .skill-header {
        padding: 20px 15px;
    }
    
    .skill-title-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .skill-icon-large {
        width: 80px;
        height: 80px;
    }
    
    .skill-icon-large img {
        width: 72px !important;
        height: 72px !important;
        min-width: 72px;
        min-height: 72px;
    }
    
    .skill-content .skill-title {
        font-size: 1.3rem;
    }
    
    .skill-content .skill-description {
        font-size: 0.9rem;
        display: block;
    }
    
    .stories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .story-card {
        padding: 15px;
    }
    
    .story-title {
        font-size: 1rem;
    }
    
    .story-preview {
        font-size: 0.85rem;
    }
    
    /* ----------------------------------------
       BUILDERS (Guided, AI, Conversational)
       ---------------------------------------- */
    .builder-container {
        padding: 15px;
    }
    
    .step-indicator {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }
    
    .step-dot {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .step-text {
        font-size: 0.7rem;
    }
    
    .step-counter {
        font-size: 0.8rem;
    }
    
    .star-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .star-section h3 {
        font-size: 1.1rem;
    }
    
    .star-section textarea {
        min-height: 120px;
        font-size: 0.95rem;
    }
    
    .builder-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .builder-actions button {
        width: 100%;
    }
    
    /* Conversational Builder */
    .chat-container {
        padding: 15px;
    }
    
    .message-bubble {
        max-width: 90%;
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .chat-input-container {
        padding: 10px;
    }
    
    .chat-input {
        font-size: 16px;
    }
    
    /* Resume Selection */
    .resume-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .resume-card {
        padding: 15px;
    }
    
    /* ----------------------------------------
       HELP PAGE
       ---------------------------------------- */
    .help-container {
        padding: 15px;
    }
    
    .help-title {
        font-size: 1.5rem;
    }
    
    .help-subtitle {
        font-size: 0.9rem;
    }
    
    .faq-section {
        padding: 15px 0;
    }
    
    .faq-category-title {
        font-size: 1.1rem;
    }
    
    .faq-item {
        padding: 12px;
    }
    
    .faq-question {
        font-size: 0.95rem;
    }
    
    .faq-answer {
        font-size: 0.85rem;
    }
    
    /* ----------------------------------------
       BUTTONS & ICONS - Global
       ---------------------------------------- */
    .btn-primary,
    .btn-secondary,
    .btn-custom {
        padding: 12px 18px;
        font-size: 0.9rem;
        min-height: 44px; /* Touch target */
    }
    
    .btn-icon {
        width: 40px;
        height: 40px;
    }
    
    /* ----------------------------------------
       CARDS - Global
       ---------------------------------------- */
    .card,
    .glass-card,
    .info-card {
        border-radius: 12px;
        padding: 15px;
    }
    
    /* ----------------------------------------
       DEV BANNER
       ---------------------------------------- */
    .dev-banner {
        font-size: 0.75rem;
        padding: 6px 10px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .dev-switcher-inline {
        margin-left: 0;
        width: 100%;
    }
    
    .dev-switcher-inline select {
        font-size: 0.75rem;
        flex: 1;
    }
    
    /* ----------------------------------------
       FOOTER
       ---------------------------------------- */
    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    /* ----------------------------------------
       BETA FEEDBACK BUTTON
       ---------------------------------------- */
    .beta-feedback-btn {
        bottom: 15px;
        right: 15px;
        padding: 10px 15px;
        font-size: 0.8rem;
    }
    
    /* ----------------------------------------
       ANIMATIONS - Reduce for performance
       ---------------------------------------- */
    .float-animation {
        animation-duration: 8s;
    }
    
    .particles {
        opacity: 0.3;
    }
}

/* ========================================
   PHONE BREAKPOINT (max-width: 480px)
   ======================================== */

@media (max-width: 480px) {
    
    /* ----------------------------------------
       NAVIGATION - Compact Mode
       ---------------------------------------- */
    .nav-glass {
        padding: 8px 10px;
    }
    
    .brand-logo {
        width: 28px;
        height: 28px;
    }
    
    .brand-name {
        font-size: 1rem;
    }
    
    .nav-actions {
        gap: 4px;
    }
    
    .btn-nav {
        padding: 5px 8px;
        font-size: 0.7rem;
    }
    
    .btn-nav span,
    .btn-nav .me-2 + span {
        display: none;
    }
    
    .btn-nav i {
        margin: 0;
    }
    
    /* ----------------------------------------
       MODALS - Mobile Friendly (with backdrop click area)
       ---------------------------------------- */
    .modal-overlay {
        padding: 15px;
        align-items: center;
        justify-content: center;
    }
    
    .modal-content {
        width: 92%;
        max-width: 92%;
        max-height: 90vh;
        border-radius: 12px;
    }
    
    .modal-header h2,
    .modal-header h3,
    .modal-title {
        font-size: 1rem;
    }
    
    /* ----------------------------------------
       MVP FLOW - Phone Portrait Fix
       ---------------------------------------- */
    .main-container {
        padding-top: 60px;
        min-height: auto;
        padding-bottom: 20px;
    }
    
    .nav-glass {
        padding: 10px 15px;
    }
    
    .glass-card {
        padding: 15px 12px;
        min-height: auto;
    }
    
    .glass-card form {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }
    
    .content-wrapper {
        padding: 0 10px;
    }
    
    .page-header {
        margin-bottom: 15px;
    }
    
    textarea {
        min-height: 100px;
    }
    
    .upload-zone {
        padding: 20px 12px;
        min-height: 100px;
    }
    
    .btn-analyze {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .btn-analyze span {
        font-size: 0.85rem;
    }
    
    .hero-cta {
        flex-direction: column;
        gap: 10px;
    }
    
    .hero-cta .btn-primary,
    .hero-cta .btn-secondary {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    /* ----------------------------------------
       STORY DECK - Single Column
       ---------------------------------------- */
    .story-deck-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .bucket-card {
        min-height: 100px;
        padding: 12px;
    }
    
    .bucket-title {
        font-size: 0.85rem;
    }
    
    .progress-ring {
        width: 32px;
        height: 32px;
    }
    
    /* ----------------------------------------
       SKILL GALLERY - Phone Icon Fix
       ---------------------------------------- */
    .skill-icon-large {
        width: 64px;
        height: 64px;
    }
    
    .skill-icon-large img {
        width: 56px !important;
        height: 56px !important;
        min-width: 56px;
        min-height: 56px;
    }
    
    .skill-content .skill-title {
        font-size: 1.2rem;
    }
    
    /* ----------------------------------------
       ANALYTICS - Compact Charts
       ---------------------------------------- */
    .chart-container {
        padding: 10px;
        min-height: 200px;
    }
    
    .chart-container canvas {
        max-height: 180px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    /* ----------------------------------------
       WINGSPAN - Single Column Badges
       ---------------------------------------- */
    .badges-grid {
        grid-template-columns: 1fr;
    }
    
    .flip-card {
        min-height: 150px;
    }
    
    /* ----------------------------------------
       PRACTICE - Compact Feedback + STAR Reference
       ---------------------------------------- */
    .record-btn {
        width: 60px;
        height: 60px;
    }
    
    .record-btn i {
        font-size: 1.5rem;
    }
    
    .recording-timer {
        font-size: 1.2rem;
    }
    
    .score-value {
        font-size: 1.3rem;
    }
    
    /* STAR Story Reference - Prevent endless scroll on phones */
    .story-reference,
    .content-section .definition-text,
    #starStoryText {
        font-size: 0.9rem;
        line-height: 1.5;
        white-space: normal;
        max-height: 320px;
        overflow-y: auto;
        padding: 16px;
        border-radius: 12px;
    }
    
    .content-section {
        padding: 16px 12px;
    }
    
    .section-title-with-legend {
        gap: 8px;
    }
    
    .highlight-legend {
        gap: 6px;
    }
    
    .legend-item {
        font-size: 0.7rem;
    }
    
    /* ----------------------------------------
       LANDING PAGE - Ultra Compact
       ---------------------------------------- */
    .hero-section {
        min-height: auto;
        align-items: flex-start;
        padding: 90px 10px 30px;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    /* Landing page section headings - larger on mobile */
    .problem-section .section-title,
    .features-section .section-title,
    .section-container .section-title,
    .features-header .section-title {
        font-size: 1.6rem !important;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    .problem-section .section-subtitle,
    .section-container .section-subtitle {
        font-size: 1.1rem;
        line-height: 1.6;
    }
    
    .hero-logo {
        width: 120px;
        height: 120px;
    }
    
    .feature-card {
        padding: 20px 15px;
    }
    
    .feature-icon {
        width: 45px;
        height: 45px;
    }
    
    /* ----------------------------------------
       RESULTS - Single Column Skills
       ---------------------------------------- */
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .skill-card {
        min-height: 80px;
    }
    
    /* ----------------------------------------
       BUILDERS - Compact Steps
       ---------------------------------------- */
    .step-dot {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
    
    .star-section {
        padding: 12px;
    }
    
    .star-section textarea {
        min-height: 100px;
    }
    
    /* ----------------------------------------
       ANIMATIONS - Disable for performance
       ---------------------------------------- */
    .float-animation {
        animation: none;
    }
    
    .particles {
        display: none;
    }
    
    .bg-mesh::after {
        animation: none;
    }
    
    /* ----------------------------------------
       UTILITY ADJUSTMENTS
       ---------------------------------------- */
    .container,
    .main-container {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* ========================================
   TOUCH DEVICE OPTIMIZATIONS
   ======================================== */

@media (hover: none) and (pointer: coarse) {
    /* Ensure adequate touch targets */
    button,
    .btn-nav,
    .btn-primary,
    .btn-secondary,
    a.btn,
    .bucket-card,
    .skill-card,
    .story-card,
    .faq-item {
        min-height: 44px;
    }
    
    /* Disable hover effects that feel wrong on touch */
    .bucket-card:hover::before,
    .skill-card:hover::before,
    .feature-card:hover::before {
        opacity: 0;
    }
}
