/* :root {
    --h1-size-desktop: 2.5rem;
    --h2-size-desktop: 2rem;
    --h3-size-desktop: 1.75rem;
    --p-size-desktop: 1rem;
    
    --h1-size-tablet: 2.25rem;
    --h2-size-tablet: 1.75rem;
    --h3-size-tablet: 1.5rem;
    --p-size-tablet: 1rem;
    
    --h1-size-mobile: 2rem;
    --h2-size-mobile: 1.5rem;
    --h3-size-mobile: 1.25rem;
    --p-size-mobile: 0.875rem;
}

h1 {
    font-size: var(--h1-size-desktop);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: var(--h2-size-desktop);
    line-height: 1.3;
    margin-bottom: 1.25rem;
}

h3 {
    font-size: var(--h3-size-desktop);
    line-height: 1.4;
    margin-bottom: 1rem;
}

p {
    font-size: var(--p-size-desktop);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.preview-section {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    padding: 2rem;
    max-height: 100vh;
    overflow: hidden;
}

.biodata-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.photo-section {
    align-self: start;
    position: sticky;
    top: 2rem;
}

.watermark {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    color: var(--text-lighter);
    opacity: 0.5;
}

@media (max-width: 1024px) {
    h1 { font-size: var(--h1-size-tablet); }
    h2 { font-size: var(--h2-size-tablet); }
    h3 { font-size: var(--h3-size-tablet); }
    p { font-size: var(--p-size-tablet); }

    .container {
        max-width: 90%;
        padding: 0 2rem;
    }

    .preview-section {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .photo-section {
        position: relative;
        top: 0;
        max-width: 300px;
        margin: 0 auto;
    }

    .nav-list {
        gap: 1rem;
    }

    .template-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    h1 { font-size: var(--h1-size-mobile); }
    h2 { font-size: var(--h2-size-mobile); }
    h3 { font-size: var(--h3-size-mobile); }
    p { font-size: var(--p-size-mobile); }

    .container {
        padding: 0 1rem;
    }

    .preview-section {
        padding: 1rem;
        margin: 0;
    }

    .biodata-content {
        padding: 1rem;
        margin-bottom: 2rem;
    }

    .site-header {
        padding: 0.75rem 0;
    }

    .main-nav {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        box-shadow: var(--shadow-md);
        z-index: 1000;
    }

    .main-nav.is-open {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-list li {
        width: 100%;
    }

    .mobile-menu-toggle {
        display: block;
    }

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

    .form-section {
        padding: 1rem;
    }

    input, select, textarea {
        font-size: 16px; 
    }

    .template-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-section {
        padding: 0 1rem;
    }

    .hero-section {
        padding: 2rem 1rem;
        text-align: center;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .dialog-content {
        width: 95%;
        max-height: 90vh;
        margin: 1rem;
        padding: 1rem;
    }
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (max-width: 1200px) {
    .container {
        max-width: 100%;
    }
}

.hide-on-mobile {
    display: none !important;
}

@media (min-width: 769px) {
    .hide-on-desktop {
        display: none !important;
    }
    
    .hide-on-mobile {
        display: initial !important;
    }
}

@media (hover: none) {
    .btn:hover {
        transform: none;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea {
        font-size: 16px;
    }
    
    select {
        padding-right: 2rem;
    }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo img {
        image-rendering: -webkit-optimize-contrast;
    }
}

@media (max-height: 450px) and (orientation: landscape) {
    .biodata-preview {
        height: auto;
        min-height: 100vh;
    }
    
    .warning-landscape {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.9);
        color: white;
        justify-content: center;
        align-items: center;
        z-index: 9999;
        text-align: center;
        padding: 2rem;
    }
} */

/* Responsive Typography */
:root {
    --h1-size-desktop: 2.5rem;
    --h2-size-desktop: 2rem;
    --h3-size-desktop: 1.75rem;
    --p-size-desktop: 1rem;
    
    --h1-size-tablet: 2.25rem;
    --h2-size-tablet: 1.75rem;
    --h3-size-tablet: 1.5rem;
    --p-size-tablet: 1rem;
    
    --h1-size-mobile: 2rem;
    --h2-size-mobile: 1.5rem;
    --h3-size-mobile: 1.25rem;
    --p-size-mobile: 0.875rem;
}

/* Desktop Typography */
h1 {
    font-size: var(--h1-size-desktop);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: var(--h2-size-desktop);
    line-height: 1.3;
    margin-bottom: 1.25rem;
}

h3 {
    font-size: var(--h3-size-desktop);
    line-height: 1.4;
    margin-bottom: 1rem;
}

p {
    font-size: var(--p-size-desktop);
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Preview Section Styles */
.preview-section {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    padding: 2rem;
    max-height: 100vh;
    overflow: hidden;
}

.biodata-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.photo-section {
    align-self: start;
    position: sticky;
    top: 2rem;
}

.watermark {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    color: var(--text-lighter);
    opacity: 0.5;
}

/* Tablet Styles */
@media (max-width: 1024px) {
    /* Typography */
    h1 { font-size: var(--h1-size-tablet); }
    h2 { font-size: var(--h2-size-tablet); }
    h3 { font-size: var(--h3-size-tablet); }
    p { font-size: var(--p-size-tablet); }

    /* Layout */
    .container {
        max-width: 90%;
        padding: 0 2rem;
    }

    .preview-section {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .photo-section {
        position: relative;
        top: 0;
        max-width: 300px;
        margin: 0 auto;
    }

    /* Navigation */
    .nav-list {
        gap: 1rem;
    }

    /* Template Gallery */
    .template-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    /* Forms and Controls */
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Features Grid */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    /* Typography */
    h1 { font-size: var(--h1-size-mobile); }
    h2 { font-size: var(--h2-size-mobile); }
    h3 { font-size: var(--h3-size-mobile); }
    p { font-size: var(--p-size-mobile); }

    /* Layout */
    .container {
        padding: 0 1rem;
    }

    .preview-section {
        padding: 1rem;
        margin: 0;
    }

    .biodata-content {
        padding: 1rem;
        margin-bottom: 2rem;
    }

    /* Navigation */
    .site-header {
        padding: 0.75rem 0;
    }

    .main-nav {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        box-shadow: var(--shadow-md);
        z-index: 1000;
    }

    .main-nav.is-open {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-list li {
        width: 100%;
    }

    .mobile-menu-toggle {
        display: block;
    }

    /* Forms and Controls */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-section {
        padding: 1rem;
    }

    input, select, textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Template Gallery */
    .template-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-section {
        padding: 0 1rem;
    }

    /* Hero Section */
    .hero-section {
        padding: 2rem 1rem;
        text-align: center;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    /* Features Grid */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Buttons */
    .btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    /* Dialogs and Modals */
    .dialog-content {
        width: 95%;
        max-height: 90vh;
        margin: 1rem;
        padding: 1rem;
    }
}

/* General Responsive Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (max-width: 1200px) {
    .container {
        max-width: 100%;
    }
}

/* Responsive Utilities */
.hide-on-mobile {
    display: none !important;
}

@media (min-width: 769px) {
    .hide-on-desktop {
        display: none !important;
    }
    
    .hide-on-mobile {
        display: initial !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) {
    .btn:hover {
        transform: none;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea {
        font-size: 16px;
    }
    
    select {
        padding-right: 2rem;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Landscape Mode Prevention */
@media (max-height: 450px) and (orientation: landscape) {
    .biodata-preview {
        height: auto;
        min-height: 100vh;
    }
    
    .warning-landscape {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.9);
        color: white;
        justify-content: center;
        align-items: center;
        z-index: 9999;
        text-align: center;
        padding: 2rem;
    }
}
