/* =========================================================
   PRO TAMIL BIBLE — RESPONSIVE SYSTEM
   Desktop / Tablet / Mobile
   ========================================================= */


/* =========================================================
   1. LARGE DESKTOP
   ========================================================= */

@media (min-width: 1600px) {

    :root {
        --sidebar-width: 270px;
        --right-panel-width: 360px;
    }

    .main-content {
        padding: 26px 30px;
    }

    .speech-display {
        min-height: 175px;
    }

    .results-container {
        max-height: 500px;
    }

    .verse-text {
        font-size: 19px;
    }
}


/* =========================================================
   2. DESKTOP
   ========================================================= */

@media (max-width: 1400px) {

    :root {
        --sidebar-width: 225px;
        --right-panel-width: 290px;
    }

    .topbar {
        padding: 0 17px;
    }

    .brand {
        min-width: 210px;
    }

    .topbar-actions {
        min-width: 210px;
    }

    .main-content {
        padding: 18px;
    }

    .right-panel {
        padding: 16px 11px;
    }

    .verse-text {
        font-size: 15px;
    }
}


/* =========================================================
   3. SMALL DESKTOP / LAPTOP
   ========================================================= */

@media (max-width: 1200px) {

    :root {
        --sidebar-width: 205px;
        --right-panel-width: 270px;
    }

    .brand-text h1 {
        font-size: 15px;
    }

    .brand-text span {
        font-size: 8px;
    }

    .content-header {
        align-items: flex-start;
    }

    .content-header h2 {
        font-size: 20px;
    }

    .session-info {
        display: none;
    }

    .speech-display {
        min-height: 125px;
    }

    .results-container {
        max-height: 380px;
    }

    .presenter-text {
        font-size: clamp(25px, 3.5vw, 52px);
    }
}


/* =========================================================
   4. TABLET LANDSCAPE
   ========================================================= */

@media (max-width: 1024px) {

    :root {
        --sidebar-width: 190px;
        --right-panel-width: 245px;
    }

    .topbar {
        height: 64px;
    }

    .brand {
        min-width: auto;
    }

    .brand-icon {
        width: 37px;
        height: 37px;
    }

    .brand-text h1 {
        font-size: 14px;
    }

    .brand-text span {
        display: none;
    }

    .topbar-center {
        justify-content: flex-end;
    }

    .system-status {
        font-size: 9px;
    }

    .topbar-actions {
        min-width: auto;
    }

    .workspace {
        min-height: calc(100vh - 64px);
    }

    .sidebar {
        padding: 14px 10px;
    }

    .main-content {
        padding: 15px;
    }

    .right-panel {
        padding: 14px 9px;
    }

    .section-title {
        font-size: 9px;
    }

    .upload-button {
        padding: 8px;
    }

    .mic-button {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .mic-button-state {
        display: none;
    }

    .speech-display {
        min-height: 115px;
    }

    .verse-preview {
        min-height: 180px;
        padding: 14px 10px;
    }

    .verse-text {
        font-size: 13px;
    }

    .shortcut-item {
        font-size: 8px;
    }
}


/* =========================================================
   5. TABLET PORTRAIT
   ========================================================= */

@media (max-width: 850px) {

    .workspace {
        grid-template-columns:
            190px
            minmax(0, 1fr);
    }

    .right-panel {
        display: none;
    }

    .topbar-center {
        display: none;
    }

    .topbar {
        padding: 0 14px;
    }

    .brand {
        flex: 1;
    }

    .topbar-actions {
        min-width: auto;
    }

    .main-content {
        padding: 16px;
    }

    .content-header {
        margin-bottom: 14px;
    }

    .content-header h2 {
        font-size: 19px;
    }

    .content-header p {
        font-size: 10px;
    }

    .results-container {
        max-height: 450px;
    }
}


/* =========================================================
   6. MOBILE
   ========================================================= */

@media (max-width: 650px) {

    :root {
        --topbar-height: 60px;
        --statusbar-height: 30px;
    }

    body {
        overflow-x: hidden;
    }

    .topbar {
        height: 60px;

        padding: 0 10px;
    }

    .brand-icon {
        width: 35px;
        height: 35px;

        border-radius: 9px;

        font-size: 17px;
    }

    .brand-text h1 {
        font-size: 13px;
    }

    .topbar-actions {
        gap: 4px;
    }

    .icon-button {
        width: 34px;
        height: 34px;
    }


    /* Main layout */

    .workspace {
        display: flex;
        flex-direction: column;

        min-height: auto;
    }


    /* Sidebar becomes top control panel */

    .sidebar {
        width: 100%;

        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 8px;

        padding: 10px;

        border-right: none;
        border-bottom: 1px solid var(--border);

        overflow: visible;
    }

    .sidebar-section {
        margin: 0;
        padding: 0;

        border: none;
    }

    .sidebar-section:nth-child(3) {
        grid-column: 1 / -1;
    }

    .sidebar-section:nth-child(4) {
        grid-column: 1 / -1;
    }

    .sidebar-footer {
        display: none;
    }

    .section-title {
        margin-bottom: 6px;

        font-size: 8px;
    }

    .upload-button {
        min-height: 48px;
    }

    .upload-button strong {
        font-size: 10px;
    }

    .upload-button small {
        display: none;
    }

    .mic-button {
        min-height: 48px;
    }

    .side-action-button {
        min-height: 37px;

        margin-bottom: 5px;
    }

    .quick-button {
        height: 35px;
    }


    /* Main content */

    .main-content {
        padding: 12px;
    }

    .content-header {
        display: block;

        margin-bottom: 12px;
    }

    .content-header h2 {
        font-size: 18px;
    }

    .content-header p {
        font-size: 9px;
    }

    .eyebrow {
        font-size: 8px;
    }


    /* Speech */

    .speech-display {
        min-height: 125px;

        padding: 18px 12px;
    }

    .speech-placeholder strong {
        font-size: 11px;
    }

    .speech-placeholder span {
        font-size: 8px;
    }


    /* Search */

    .search-panel {
        grid-template-columns: 1fr;

        gap: 6px;
    }

    .search-button {
        width: 100%;
    }


    /* Results */

    .results-container {
        max-height: none;

        padding: 8px;
    }

    .result-card {
        padding: 11px;
    }

    .result-ref {
        align-items: flex-start;

        flex-direction: column;
    }

    .result-text {
        font-size: 11px;
    }


    /* Status bar */

    .statusbar {
        display: flex;
        justify-content: space-between;

        padding: 0 9px;
    }

    .statusbar-center {
        display: none;
    }

    .statusbar-left {
        flex: 1;
    }

    .statusbar-right {
        flex: 0;
    }

    .footer-divider {
        display: none;
    }

    #footerBibleStatus {
        display: none;
    }


    /* Presenter */

    .presenter-toolbar {
        height: 50px;

        padding: 0 10px;
    }

    .presenter-brand {
        font-size: 9px;
    }

    .presenter-mode {
        display: none;
    }

    .presenter-content {
        padding: 30px 18px;
    }

    .presenter-reference {
        font-size: clamp(18px, 6vw, 28px);
    }

    .presenter-text {
        font-size: clamp(22px, 7vw, 38px);

        line-height: 1.65;
    }

    .presenter-footer {
        height: 32px;
    }

    .lower-third-active .presenter-content {
        margin-bottom: 25px;

        padding: 13px 15px;

        border-left-width: 5px;
    }

    .lower-third-active .presenter-reference {
        font-size: 15px;
    }

    .lower-third-active .presenter-text {
        font-size: 17px;
    }


    /* Toast */

    .toast-container {
        left: 10px;
        right: 10px;

        bottom: 40px;
    }

    .toast {
        min-width: 0;
        width: 100%;
        max-width: none;
    }
}


/* =========================================================
   7. SMALL MOBILE
   ========================================================= */

@media (max-width: 420px) {

    .brand-text h1 {
        font-size: 12px;
    }

    .brand-icon {
        width: 32px;
        height: 32px;
    }

    .icon-button {
        width: 31px;
        height: 31px;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .sidebar-section:nth-child(3),
    .sidebar-section:nth-child(4) {
        grid-column: auto;
    }

    .content-header h2 {
        font-size: 17px;
    }

    .panel-header {
        padding: 9px 10px;
    }

    .panel-title h3 {
        font-size: 11px;
    }

    .panel-icon {
        width: 30px;
        height: 30px;
    }

    .speech-display {
        min-height: 110px;
    }

    .empty-state {
        min-height: 150px;
        padding: 20px;
    }

    .search-input {
        height: 40px;
    }

    .search-button {
        height: 40px;
    }
}


/* =========================================================
   8. LANDSCAPE MOBILE
   ========================================================= */

@media (max-height: 500px) and (orientation: landscape) {

    .topbar {
        height: 50px;
    }

    .workspace {
        min-height: auto;
    }

    .sidebar {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));

        padding: 7px;
    }

    .sidebar-section:nth-child(3),
    .sidebar-section:nth-child(4) {
        grid-column: auto;
    }

    .section-title {
        display: none;
    }

    .speech-display {
        min-height: 90px;
    }

    .presenter-toolbar {
        height: 42px;
    }

    .presenter-footer {
        height: 25px;
    }
}


/* =========================================================
   9. TOUCH DEVICES
   ========================================================= */

@media (hover: none) and (pointer: coarse) {

    button,
    label {
        -webkit-tap-highlight-color: transparent;
    }

    .icon-button,
    .quick-button,
    .side-action-button {
        min-height: 40px;
    }

    .result-card:hover,
    .verse-card:hover {
        transform: none;
    }

    [data-tooltip]::after {
        display: none;
    }
}


/* =========================================================
   10. ACCESSIBILITY — LARGE TEXT
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .live-dot,
    .loading-indicator::before,
    .spinner,
    .skeleton::after {
        animation: none !important;
    }
}