/* ========================================
   Responsive Styles
   Tam mobil uyumluluk
   ======================================== */

/* --- Tablet (768px - 1199px) --- */
@media (max-width: 1199px) {
    .main {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - var(--header-height));
    }

    .editor-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        height: auto;
        max-height: none;
    }

    .editor-panel.panel-hidden {
        display: none;
    }

    .preview-panel {
        min-width: 0;
        width: 100%;
        height: auto;
        min-height: calc(100vh - var(--header-height) - var(--mobile-nav-height));
    }

    .preview-panel.panel-hidden {
        display: none;
    }

    .resize-handle {
        display: none;
    }

    /* Mobil tablar gorunur */
    .mobile-tabs {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--mobile-nav-height);
        background-color: var(--color-bg-secondary);
        border-top: 1px solid var(--color-border);
        z-index: var(--z-sticky);
    }

    .mobile-tab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--spacing-2xs);
        font-size: var(--font-size-xs);
        color: var(--color-text-muted);
        border: none;
        background: none;
        cursor: pointer;
        transition: color var(--transition-fast);
        padding: var(--spacing-xs);
    }

    .mobile-tab svg {
        width: 20px;
        height: 20px;
    }

    .mobile-tab.active {
        color: var(--color-accent);
    }

    .mobile-tab:hover {
        color: var(--color-text-primary);
    }

    /* Body padding for bottom nav */
    body {
        padding-bottom: var(--mobile-nav-height);
    }

    /* Template picker */
    .template-picker__grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 640px;
    }

    /* Preview scaling */
    .preview-panel__body {
        padding: var(--spacing-lg);
    }

    .preview-paper {
        width: 100%;
        max-width: 210mm;
        min-height: auto;
    }

    /* Header adjustments */
    .header__actions .btn span.btn-text {
        display: none;
    }
}

/* --- Mobile (< 768px) --- */
@media (max-width: 767px) {
    :root {
        --header-height: 48px;
        --spacing-xl: 1rem;
    }

    .header {
        padding: 0 var(--spacing-md);
    }

    .header__logo {
        font-size: var(--font-size-base);
    }

    .header__logo-icon {
        width: 24px;
        height: 24px;
    }

    /* Editor */
    .editor-panel__body {
        padding: var(--spacing-md);
    }

    .editor-panel__header {
        padding: var(--spacing-sm) var(--spacing-md);
    }

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

    /* Preview */
    .preview-panel__body {
        padding: var(--spacing-md);
    }

    .preview-panel__header {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .preview-paper {
        padding: 12mm 10mm;
        font-size: 9pt;
    }

    .cv-name {
        font-size: 16pt;
    }

    .cv-section__title {
        font-size: 10pt;
    }

    /* Template picker */
    .template-picker {
        padding: var(--spacing-2xl) var(--spacing-md);
    }

    .template-picker__grid {
        grid-template-columns: 1fr;
        max-width: 320px;
    }

    .template-picker__heading {
        font-size: var(--font-size-xl);
    }

    .template-picker__subheading {
        font-size: var(--font-size-sm);
        margin-bottom: var(--spacing-2xl);
    }

    /* Buttons */
    .btn {
        height: 40px;
    }

    .btn--icon {
        width: 40px;
        height: 40px;
    }

    /* Dropdown */
    .dropdown__menu {
        position: fixed;
        top: auto;
        bottom: calc(var(--mobile-nav-height) + var(--spacing-sm));
        right: var(--spacing-md);
        left: var(--spacing-md);
        min-width: auto;
    }

    /* Modal */
    .modal {
        max-width: calc(100vw - 2rem);
        margin: var(--spacing-base);
    }

    /* Footer Mobile */
    .footer-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
        text-align: center;
    }

    .footer-brand {
        align-items: center;
    }

    .footer-logo {
        justify-content: center;
    }

    .footer-links {
        text-align: center;
    }
}

/* --- Small Mobile (< 375px) --- */
@media (max-width: 374px) {
    .cv-contact {
        flex-direction: column;
        gap: 2pt;
    }

    .cv-contact__separator {
        display: none;
    }

    .header__actions .btn--sm {
        padding: var(--spacing-xs);
    }
}

/* --- Print Styles --- */
@media print {
    .header,
    .mobile-tabs,
    .editor-panel,
    .resize-handle,
    .preview-panel__header,
    .zoom-controls,
    .loading-screen {
        display: none !important;
    }

    .preview-panel {
        width: 100%;
        background: none;
    }

    .preview-panel__body {
        padding: 0;
    }

    .preview-paper {
        box-shadow: none;
        width: 100%;
        padding: 15mm;
    }

    body {
        padding-bottom: 0;
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
