/* Custom Styles for Sonmez Consulting Contract Generator */

body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* Section Title Styling */
.section-title {
    font-weight: bold;
    text-transform: uppercase;
    border-bottom: 2px solid #0e406b;
    display: inline-block;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: #0e406b;
    padding-bottom: 0.25rem;
}

/* Data Field Highlights */
.data-field {
    background-color: #fef9c3;
    padding: 0 4px;
    border-radius: 2px;
}

/* Info Box Styling */
.info-box {
    border-radius: 4px;
}

/* Language Toggle Button */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #0e406b, #1a5490);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lang-toggle:hover {
    background: linear-gradient(135deg, #1a5490, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.lang-toggle .flag {
    font-size: 1.25rem;
}

.lang-toggle .lang-text {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.lang-toggle .active-lang {
    font-weight: 700;
    text-decoration: underline;
}

/* Watermark Styles */
.watermark-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.watermark-content {
    opacity: 0.55;
    transform: rotate(-30deg);
    display: flex;
    justify-content: center;
    align-items: center;
    filter: blur(1px);
    /* Subtle blur for shadow effect */
}

.watermark-content img {
    max-width: 650px;
    width: 70%;
    max-height: 60vh;
    height: auto;
    object-fit: contain;
    /* Make it black for shadow look */
}

.logo-box {
    display: flex;
    align-items: center;
}

/* Contract Page Container */
.contract-page {
    position: relative;
    background: white;
}

.contract-page>* {
    position: relative;
    z-index: 1;
}

/* List Styling in Contract */
.contract-page ol,
.contract-page ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.contract-page li {
    margin-bottom: 0.25rem;
}

/* Table Styling */
.contract-page table {
    border-collapse: collapse;
}

.contract-page th,
.contract-page td {
    border: 1px solid #9ca3af;
}

/* Bank Details Grid - Better Layout */
#bank-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

/* Appendix Grid - Screen Layout */
#preview-appendix1 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Print Overrides - Ultra Compact Layout */
@media print {
    @page {
        margin: 0.4in;
        size: letter;
    }

    html,
    body {
        background: white !important;
        font-size: 10pt;
        line-height: 1.25;
    }
    
    p, li {
        margin-bottom: 0.2em !important;
    }
    
    h2, h3 {
        margin-top: 0.4em !important;
        margin-bottom: 0.2em !important;
    }
    
    .mb-3, .mb-4, .mb-6, .mb-8 {
        margin-bottom: 0.3em !important;
    }
    
    .mt-4, .mt-6, .mt-8 {
        margin-top: 0.4em !important;
    }
    
    .ml-4 {
        margin-left: 0.6em !important;
    }
    
    section {
        margin-top: 0.4em !important;
        margin-bottom: 0.4em !important;
    }
    
    /* Appendix table print - compact */
    .appendix-table {
        font-size: 9pt !important;
        width: 100% !important;
    }
    
    .appendix-table td {
        padding: 0.15em 0.3em !important;
        line-height: 1.2 !important;
    }
    
    .appendix-table .category-header td {
        padding: 0.2em 0.3em !important;
        font-size: 9.5pt !important;
    }

    .no-print {
        display: none !important;
    }

    .print-w-full {
        width: 100% !important;
    }

    .print-absolute {
        position: absolute !important;
    }

    .shadow-2xl {
        box-shadow: none !important;
    }

    /* Remove yellow highlights for print */
    .data-field {
        background-color: transparent !important;
        padding: 0;
        border-bottom: 1px solid #000;
    }

    /* Page break controls */
    .page-break {
        page-break-before: always;
        break-before: page;
    }

    .avoid-break {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Section breaks - removed to allow content flow */
    /* .mb-6 { page-break-inside: avoid; } */

    /* Watermark for print */
    .watermark-container {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 0 !important;
        display: flex !important;
        opacity: 0.12 !important;
        visibility: visible !important;
    }

    .watermark-content {
        transform: rotate(-30deg) !important;
    }

    /* Contract page print */
    .contract-page {
        padding: 0 !important;
        background: transparent !important;
    }

    .contract-page>* {
        position: relative;
        z-index: 1;
    }

    /* Table styling for print */
    .contract-page table {
        font-size: 9pt;
    }

    /* Section title print */
    .section-title {
        border-bottom-color: #000;
        color: #000;
    }

    /* Grid layout for print */
    #preview-panel {
        width: 100% !important;
        max-width: none !important;
        background: transparent !important;
    }

    /* Signature section */
    .grid.grid-cols-2 {
        display: flex;
        gap: 2rem;
    }

    .grid.grid-cols-2>div {
        flex: 1;
    }

    /* ===== APPENDIX 1 PRINT FIX ===== */
    /* Single column layout for print - fixes crowded appearance */
    #preview-appendix1 {
        display: block !important;
        column-count: 1 !important;
    }

    #preview-appendix1>div {
        display: block !important;
        width: 100% !important;
        margin-bottom: 1rem;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    #preview-appendix1 h4 {
        font-size: 10pt !important;
        font-weight: bold;
        margin-bottom: 0.25rem;
        border-bottom: 1px solid #ccc;
        padding-bottom: 0.25rem;
    }

    #preview-appendix1 ul {
        margin: 0;
        padding-left: 1rem;
    }

    #preview-appendix1 li {
        font-size: 9pt;
        margin-bottom: 0.1rem;
    }

    /* ===== BANK DETAILS PRINT FIX ===== */
    /* Stack bank details vertically for print */
    #bank-details-grid {
        display: block !important;
    }

    #bank-details-grid>div {
        display: flex;
        margin-bottom: 0.5rem;
        padding: 0.25rem 0;
        border-bottom: 1px dotted #ccc;
    }

    #bank-details-grid>div>span:first-child {
        font-weight: bold;
        min-width: 150px;
    }

    /* Bank container */
    .bank-details-container {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* ===== FORCE ENGLISH FOR PRINT ===== */
    /* Always print in English, regardless of current language setting */
    body .lang-tr,
    body.turkish .lang-tr,
    body span.lang-tr,
    body.turkish span.lang-tr {
        display: none !important;
    }

    body .lang-en,
    body.turkish .lang-en {
        display: block !important;
    }

    body span.lang-en,
    body.turkish span.lang-en {
        display: inline !important;
    }
}

/* Appendix Table Styling */
.appendix-table {
    font-size: 0.75rem;
    border-collapse: collapse;
}

.appendix-table td {
    vertical-align: top;
    line-height: 1.3;
}

.appendix-table .category-header td {
    font-weight: bold;
    background: #f3f4f6;
}

/* Accordion Animation */
#services-accordion .hidden {
    display: none;
}

/* Editor/Preview Toggle (Mobile) */
@media (max-width: 1023px) {
    #editor-panel.hidden-mobile {
        display: none;
    }

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

/* Custom scrollbar for editor */
#editor-panel::-webkit-scrollbar {
    width: 6px;
}

#editor-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#editor-panel::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#editor-panel::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Language specific content */
/* Default state: English only (hide Turkish) */
body:not(.turkish) .lang-tr,
body:not(.turkish) span.lang-tr {
    display: none !important;
}

body:not(.turkish) .lang-en {
    display: block !important;
}

body:not(.turkish) span.lang-en {
    display: inline !important;
}

/* Turkish state: Turkish only (hide English) */
body.turkish .lang-en,
body.turkish span.lang-en {
    display: none !important;
}

body.turkish .lang-tr {
    display: block !important;
}

body.turkish span.lang-tr {
    display: inline !important;
}
    /* Make Article 3.1.1 compact for print */
    .bg-yellow-50 {
        background-color: transparent !important;
        border-left: 2px solid #000 !important;
        padding: 0.3em !important;
    }
    
    /* Compact table styling */
    table {
        font-size: 8pt !important;
    }
    
    th, td {
        padding: 0.2em 0.4em !important;
    }
    
    /* Reduce list spacing */
    ol, ul {
        margin: 0.2em 0 !important;
        padding-left: 1.2em !important;
    }
    
    li {
        margin-bottom: 0.15em !important;
    }
