:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #10b981;
    --secondary-hover: #059669;
    --bg-color: #f3f4f6;
    --panel-bg: rgba(255, 255, 255, 0.85);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --font-family: 'Inter', sans-serif;
    --a4-width: 210mm;
    --a4-height: 297mm;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    background-image: radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    transition: background-color 0.3s ease;
}

body[data-theme="okul"] {
    --theme-color: #3b82f6;
    --theme-bg: rgba(59, 130, 246, 0.1);
}

body[data-theme="ilce"] {
    --theme-color: #10b981;
    --theme-bg: rgba(16, 185, 129, 0.1);
}

body[data-theme="il"] {
    --theme-color: #8b5cf6;
    --theme-bg: rgba(139, 92, 246, 0.1);
}

/* App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
}

.font-light {
    font-weight: 300;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    display: none;
}

@media (min-width: 768px) {
    .subtitle {
        display: block;
    }
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Main Content Split */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 1rem;
    gap: 1rem;
}

/* Left Editor Section */
.editor-section {
    flex: 1;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Right Preview Section */
.preview-section {
    flex: 2;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
    display: block;
    padding: 1rem;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 0.8);
}

/* Cards & Panels */
.card {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.panel-header {
    padding: 0.4rem 0.6rem;
    border-bottom: 2px solid var(--theme-color, var(--border-color));
    background: var(--theme-bg, rgba(255, 255, 255, 0.5));
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.collapsible-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.collapsible-header:hover {
    background: rgba(255, 255, 255, 0.7);
}

.toggle-icon {
    color: var(--text-muted);
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.panel.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.panel.collapsed .panel-body {
    display: none;
}

.panel-header h2 {
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-main);
    margin: 0;
}

.panel-header h2 i {
    color: var(--theme-color, var(--primary-color));
    transition: color 0.3s ease;
}

.panel-body {
    padding: 0.4rem 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 0.3rem;
}

.form-row {
    display: flex;
    gap: 0.4rem;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
    color: var(--text-main);
}

input, select, textarea {
    width: 100%;
    padding: 0.2rem 0.3rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-family: var(--font-family);
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Custom Autocomplete Dropdown */
.custom-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    margin: 0;
    padding: 0;
    list-style: none;
    display: none;
}

.custom-dropdown.show {
    display: block;
}

.custom-dropdown li {
    padding: 0.25rem 0.5rem; /* Azaltılmış satır aralığı */
    cursor: pointer;
    font-size: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    color: var(--text-main);
}

.custom-dropdown li:hover {
    background: var(--primary-color);
    color: white;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-outline {
    background-color: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-danger-text {
    background: transparent;
    color: #ef4444;
    padding: 0.2rem 0.4rem;
}
.btn-danger-text:hover {
    background: #fee2e2;
}

.w-100 {
    width: 100%;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.2rem;
    background-color: #ffffff;
    min-width: 160px;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    z-index: 1000;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.dropdown-content a {
    color: var(--text-main);
    padding: 0.6rem 1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.dropdown-content a:hover {
    background-color: #f3f4f6;
}

.show-dropdown {
    display: block;
}

/* Lists */
.attendee-list, .agenda-list {
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    max-height: 80px;
    overflow-y: auto;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0.4rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    box-shadow: var(--shadow-sm);
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-weight: 600;
    font-size: 0.85rem;
}

.list-item-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Document Preview (A4 simulation) */
.document-wrapper {
    width: 100%;
    display: block;
    overflow-y: auto;
    padding: 2rem;
    text-align: center;
}

.document-page {
    width: var(--a4-width);
    min-height: var(--a4-height);
    background: white;
    margin: 0 auto;
    text-align: left;
    padding: 2.5cm; /* Standard margin */
    box-shadow: var(--shadow-lg);
    font-family: 'Times New Roman', Times, serif; /* Formal document font */
    color: black;
    line-height: 1.4;
    font-size: 11pt;
}

.print-header td, .print-footer td {
    height: 0;
}

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

.doc-header h3, .doc-header h4 {
    margin: 0 0 0.5rem 0;
    font-weight: bold;
    text-transform: uppercase;
}
.doc-header h3 { font-size: 13pt; }
.doc-header h4 { font-size: 12pt; }

.doc-info-table {
    width: 100%;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
}

.doc-info-table th {
    text-align: left;
    width: 35%;
    font-weight: bold;
    vertical-align: top;
    padding-bottom: 0.3rem;
}

.doc-info-table td {
    vertical-align: top;
    padding-bottom: 0.3rem;
}

.doc-section {
    margin-bottom: 1.5rem;
}

.doc-section h5 {
    font-size: 11pt;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.doc-agenda-list {
    padding-left: 1.5rem;
}
.doc-agenda-list li {
    margin-bottom: 0.3rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.decision-block {
    margin-bottom: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.decision-block h6 {
    font-size: 11pt;
    font-weight: bold;
    margin-bottom: 0.3rem;
}

.doc-signatures {
    margin-top: 3rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 2rem;
    text-align: center;
}

.sig-box {
    margin-bottom: 2rem;
    width: 30%;
    min-width: 150px;
}

.sig-name {
    font-weight: bold;
}

.sig-title {
    font-size: 10pt;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: none;
        background-color: white;
    }

    .app-container, .main-content, .preview-section, .document-wrapper {
        height: auto;
        overflow: visible;
        display: block !important;
        background: none;
        padding: 0;
        margin: 0;
    }

    .document-page {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 0;
        padding: 0;
        margin: 0;
        box-shadow: none;
        overflow: visible;
        border: none;
    }

    /* Prevent breaking inside blocks */
    .decision-block, .doc-signatures, .doc-info-table tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .print-header td, .print-footer td {
        height: 2.5cm;
    }
    
    @page {
        size: A4;
        margin: 0 2.5cm; /* Top/Bottom 0 hides browser headers, Left/Right 2.5cm is standard A4 */
    }
}

/* Meeting Type Selector */
.meeting-type-selector {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 1rem;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.type-btn {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    background: #f9fafb;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.type-btn:hover {
    background: #f3f4f6;
    color: var(--text-main);
}

.type-btn[data-type="okul"].active {
    background: #3b82f6; /* Blue */
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.5);
}

.type-btn[data-type="ilce"].active {
    background: #10b981; /* Green */
    color: white;
    border-color: #10b981;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.5);
}

.type-btn[data-type="il"].active {
    background: #8b5cf6; /* Purple */
    color: white;
    border-color: #8b5cf6;
    box-shadow: 0 4px 6px -1px rgba(139, 92, 246, 0.5);
}
