/* res_permits.css - Responsive styles for permits page */

/* Mobile First Approach */
@media (max-width: 768px) {
    /* Banner Section */
    .banner-permit {
        padding: 30px 15px;
        margin-top: 60px;
    }

    .banner-title {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .banner-description {
        font-size: 1rem;
        padding: 0 10px;
    }

    /* Main Content Layout */
    .content-container {
        flex-direction: column;
        gap: 20px;
        padding: 0 15px;
        margin: 20px auto;
    }

    .left-container,
    .right-container {
        width: 100% !important;
        padding: 20px 15px;
    }

    /* Progress Indicator */
    .progress-indicator {
        max-width: 100%;
        margin: 15px auto;
        padding: 0 10px;
    }

    .step span {
        font-size: 11px;
        text-align: center;
    }

    .circle {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }

    .line {
        margin-bottom: 22px;
        height: 3px;
    }

    /* Form Layout */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group {
        margin-bottom: 15px;
        width: 100%;
    }

    .form-box {
        padding: 15px;
        margin: 0 auto 30px auto;
        width: 95%;
    }

    .form-title {
        font-size: 1.5rem;
    }

    /* Form Elements */
    input, select, textarea {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
        margin-bottom: 15px;
    }

    label {
        font-size: 16px;
        margin-bottom: 8px;
    }

    /* Button Container */
    .button-container {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }

    .back-btn, .submit-btn, .next-btn {
        width: 100%;
        padding: 12px;
        margin: 0;
        font-size: 16px;
    }

    /* Review Section */
    .review-table {
        font-size: 14px;
    }

    .review-table td {
        padding: 6px;
        display: block;
        width: 100%;
        border: none;
        border-bottom: 1px solid #ddd;
    }

    .review-table td:first-child {
        width: 100%;
        background-color: #f5f5f5;
        font-weight: bold;
        padding: 8px 6px;
    }

    .review-table tr {
        display: block;
        margin-bottom: 10px;
        border: 1px solid #ddd;
        border-radius: 5px;
        overflow: hidden;
    }

    /* Success Section */
    .success-container {
        padding: 20px 15px;
    }

    .success-icon {
        width: 80px;
        height: 80px;
        font-size: 48px;
    }

    .ref-container {
        flex-direction: column;
        gap: 10px;
    }

    #reference-number {
        font-size: 20px;
        text-align: center;
        padding: 10px;
    }

    #copy-btn {
        width: 100%;
    }

    .reference-number h3 {
        font-size: 18px;
    }

    /* Note Section */
    .note-section {
        padding: 15px;
    }

    .contact-numbers {
        flex-direction: column;
        gap: 5px;
    }

    /* Permit Sections */
    .permit-section {
        padding: 15px;
    }

    .ownership-options,
    .fee-options {
        gap: 8px;
    }

    .option label {
        font-size: 0.9em;
    }

    /* Total Fee */
    .total-fee {
        padding: 12px;
    }

    .total-fee h3 {
        font-size: 1.1em;
    }

    /* Next Steps */
    .next-steps {
        padding: 15px;
        margin: 20px 0;
    }

    .next-steps h3 {
        font-size: 1.1em;
    }

    /* Modal Adjustments */
    .modal-content {
        width: 90%;
        padding: 20px;
        margin: 20px;
    }
}

/* Tablet Styles (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .content-container {
        max-width: 95%;
        gap: 25px;
        margin: 25px auto;
    }

    .left-container,
    .right-container {
        width: 48% !important;
    }

    .banner-permit {
        padding: 40px 20px;
    }

    .banner-title {
        font-size: 2.2rem;
    }

    .banner-description {
        font-size: 1.1rem;
    }

    .form-box {
        padding: 25px;
        max-width: 95%;
    }

    .progress-indicator {
        max-width: 90%;
    }

    .button-container {
        gap: 20px;
    }

    .back-btn, .submit-btn, .next-btn {
        padding: 12px 25px;
    }
}

/* Small Desktop/Laptop Styles (1025px - 1440px) */
@media (min-width: 1025px) and (max-width: 1440px) {
    .content-container {
        max-width: 1300px;
        gap: 30px;
    }

    .left-container,
    .right-container {
        width: 48% !important;
    }

    .form-box {
        max-width: 1100px;
    }
}

/* Large Desktop Styles (1441px and above) */
@media (min-width: 1441px) {
    .content-container {
        max-width: 1550px;
    }

    .left-container,
    .right-container {
        width: 48% !important;
    }

    .form-box {
        max-width: 1200px;
    }
}

/* Common Responsive Adjustments for All Devices */
@media (max-width: 768px) {
    /* Ensure proper touch targets */
    button, 
    .navbuttons, 
    .form-checkbox, 
    .option input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Improve readability */
    body {
        font-size: 16px;
        line-height: 1.5;
    }

    /* Prevent horizontal scrolling */
    html, body {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Fix for iOS Safari */
    input, select, textarea {
        border-radius: 5px;
    }

    /* Ensure form elements are easily tappable */
    select {
        background-image: none;
        padding-right: 30px;
    }
}

/* Orientation Specific Adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .banner-permit {
        padding: 20px 15px;
    }

    .content-container {
        margin: 15px auto;
    }

    .left-container,
    .right-container {
        padding: 15px;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .banner-permit {
        background-image: linear-gradient(to right, rgba(0, 51, 102, 0.7), rgba(0, 119, 182, 0.9)), 
                          url('../assets/permitbanner.png');
        background-size: cover;
    }
}

/* Print Styles */
@media print {
    .banner-permit {
        background: #003366 !important;
        color: black !important;
        box-shadow: none !important;
    }

    .button-container,
    .progress-indicator {
        display: none !important;
    }

    .form-box {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .fade-in-section {
        transition: none !important;
        animation: none !important;
    }

    .success-icon i {
        animation: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .form-box {
        background: #2d3748;
        color: #e2e8f0;
    }

    .form-input {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #718096;
    }

    .review-container {
        background: #4a5568;
        color: #e2e8f0;
    }
}

/* Fix for very small screens */
@media (max-width: 360px) {
    .banner-title {
        font-size: 1.6rem;
    }

    .banner-description {
        font-size: 0.9rem;
    }

    .progress-indicator {
        transform: scale(0.9);
    }

    .step span {
        font-size: 10px;
    }
}

/* Ensure no overlapping elements */
.left-container,
.right-container {
    position: relative;
    z-index: 1;
}

.fade-in-section {
    position: relative;
    z-index: 1;
}

/* Clear floats and prevent layout breaks */
.content-container::after {
    content: "";
    display: table;
    clear: both;
}

/* Safe area insets for modern devices */
@supports (padding: max(0px)) {
    .content-container,
    .banner-permit {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
}