/* ==========================================================================
   Öğretmenler Kurulu Toplantı Tutanağı Otomasyonu - Ana Stiller
   materyaal.com Tasarım Dili ve iframe Optimizasyonu
   ========================================================================== */

* {
    box-sizing: border-box !important;
}

body {
    background-color: #f1f5f9 !important;
    margin: 0 !important;
    padding: 6px 10px !important;
    color: #0f172a !important;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif !important;
    -webkit-text-size-adjust: 100%;
    line-height: 1.5;
}

#kurulAppWrapper {
    width: 100% !important;
    max-width: 1550px !important;
    margin: 0 auto !important;
    text-align: left !important;
}

/* Sekmeler (Tabs) */
.tab-navigation {
    display: flex;
    gap: 6px;
    background: #ffffff;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background: #f8fafc;
    color: #1e3a8a;
}

.tab-btn.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.tab-btn .tab-badge {
    background: rgba(0, 0, 0, 0.12);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
}

.tab-btn.active .tab-badge {
    background: rgba(255, 255, 255, 0.25);
}

/* Ana Düzen (Layout) */
.main-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.form-container {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Başlıklar & Bölüm Ayırıcıları */
h2.section-title {
    color: #1e3a8a !important;
    margin: 0 0 16px 0 !important;
    border-bottom: 2px solid #3b82f6 !important;
    padding-bottom: 8px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

h3.sub-section-title {
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    margin: 16px 0 8px 0;
    padding-left: 8px;
    border-left: 3px solid #3b82f6;
}

/* Form Grid & Input Elemanları */
.form-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 16px !important;
    margin-bottom: 18px !important;
}

.form-grid-3 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
    margin-bottom: 18px !important;
}

.form-grid-2 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
    margin-bottom: 18px !important;
}

.form-group {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    width: 100% !important;
    margin-bottom: 10px;
}

label {
    display: block !important;
    width: 100% !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    margin-bottom: 6px !important;
    text-align: left !important;
}

.form-hint {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
    display: block !important;
    width: 100% !important;
    padding: 9px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    background-color: #f8fafc !important;
    color: #0f172a !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit !important;
    min-height: 40px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none !important;
    border-color: #2563eb !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

textarea {
    resize: vertical !important;
    min-height: 100px !important;
    line-height: 1.5 !important;
}

/* Butonlar */
.btn-group {
    display: flex !important;
    gap: 10px !important;
    margin-top: 24px !important;
    flex-wrap: wrap !important;
    align-items: center;
}

.btn {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    min-height: 42px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary { background: #2563eb; color: #fff; }
.btn-word { background: #1e40af; color: #fff; }
.btn-word:hover { background: #172554; }
.btn-print { background: #059669; color: #fff; }
.btn-print:hover { background: #047857; }
.btn-secondary { background: #475569; color: #fff; }
.btn-secondary:hover { background: #334155; }
.btn-outline {
    background: #ffffff;
    color: #2563eb;
    border: 1px solid #2563eb;
}
.btn-outline:hover {
    background: #eff6ff;
}
.btn-accent { background: #0284c7; color: #fff; }
.btn-accent:hover { background: #0369a1; }
.btn-danger-sm {
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-danger-sm:hover { background: #b91c1c; }

.btn-sm {
    padding: 6px 12px;
    min-height: 34px;
    font-size: 12px;
}

/* Bilgilendirme Kutuları (Alerts) */
.alert-box {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.alert-warning {
    background-color: #fefce8;
    color: #854d0e;
    border: 1px solid #fef08a;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Gündem Maddeleri Kartları */
.agenda-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 14px;
    transition: border-color 0.2s;
}

.agenda-card:hover {
    border-color: #94a3b8;
}

.agenda-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.agenda-card-title {
    font-weight: 700;
    font-size: 14px;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agenda-subitems-list {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #475569;
}

.agenda-subitems-list ul {
    margin: 4px 0 0 0;
    padding-left: 20px;
}

.agenda-subitems-list li {
    margin-bottom: 2px;
}

/* Akıllı Cümle Ekleme Hapları (Pills) */
.quick-snippets-wrapper {
    margin-top: 8px;
    margin-bottom: 12px;
}

.quick-snippets-title {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.snippet-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.snippet-pill {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.snippet-pill:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

/* Komisyon & Kulüp Tabloları */
.table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin-top: 8px !important;
    margin-bottom: 16px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    background: #ffffff;
}

.custom-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 13px !important;
    min-width: 600px !important;
}

.custom-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    text-align: left !important;
    padding: 10px 12px !important;
    border-bottom: 2px solid #e2e8f0 !important;
    font-weight: 600 !important;
    white-space: nowrap;
}

.custom-table td {
    padding: 8px 12px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    vertical-align: middle;
}

.custom-table tr:hover td {
    background-color: #f8fafc;
}

.custom-table input,
.custom-table select {
    margin: 0 !important;
    min-height: 34px !important;
    font-size: 12px !important;
    padding: 6px 8px !important;
}

/* Canlı A4 Belge Önizleme Ekranı */
.preview-container {
    background: #475569 !important;
    border-radius: 12px !important;
    padding: 24px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 24px !important;
    overflow-x: auto !important;
    width: 100% !important;
    margin-top: 15px !important;
    -webkit-overflow-scrolling: touch !important;
    position: relative;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

.a4-page {
    width: 210mm !important;
    min-height: 297mm !important;
    padding: 20mm 20mm !important;
    background: #ffffff !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
    font-family: 'Times New Roman', Times, serif !important;
    font-size: 11pt !important;
    line-height: 1.45 !important;
    color: #000000 !important;
    box-sizing: border-box !important;
    text-align: justify !important;
    flex-shrink: 0 !important;
    position: relative;
}

/* Resmi MEB Belge İçi Başlık ve Format */
.doc-header {
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 12pt;
    line-height: 1.35;
}

.doc-sub-header {
    text-align: center;
    margin-bottom: 24px;
    font-weight: bold;
    font-size: 13pt;
    text-decoration: underline;
}

.doc-meta-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 10.5pt;
}

.doc-meta-table td {
    padding: 4px 6px;
    border: 1px solid #000000;
    vertical-align: top;
}

.doc-meta-table td.meta-label {
    width: 28%;
    font-weight: bold;
    background-color: #f3f4f6;
}

.doc-agenda-list {
    margin-bottom: 24px;
}

.doc-agenda-title {
    font-weight: bold;
    font-size: 11.5pt;
    margin-bottom: 8px;
    text-decoration: underline;
}

.doc-item-block {
    margin-bottom: 18px;
    page-break-inside: avoid;
}

.doc-item-title {
    font-weight: bold;
    font-size: 11pt;
    margin-bottom: 4px;
}

.doc-item-discussions {
    margin-bottom: 6px;
    text-indent: 1.5em;
}

.doc-item-decisions {
    font-weight: bold;
    background-color: #f9fafb;
    border-left: 3px solid #000000;
    padding: 4px 8px;
    margin-top: 4px;
}

.doc-signature-block {
    margin-top: 30px;
    page-break-inside: avoid;
}

.doc-signers-grid {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    text-align: center;
}

.doc-signer-box {
    width: 40%;
}

.doc-approval-box {
    text-align: center;
    margin-top: 25px;
    font-weight: bold;
}

.doc-attendance-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 9.5pt;
}

.doc-attendance-table th,
.doc-attendance-table td {
    border: 1px solid #000000;
    padding: 4px 6px;
    text-align: left;
}

.doc-attendance-table th {
    background-color: #f3f4f6;
    text-align: center;
}

/* Responsive Kurallar */
@media screen and (max-width: 900px) {
    body { padding: 8px !important; }
    .form-container { padding: 16px !important; }
    .form-grid-3, .form-grid-2 { grid-template-columns: 1fr !important; }
    .tab-navigation { gap: 4px; }
    .tab-btn { padding: 8px 12px; font-size: 12px; }
    .preview-container { align-items: flex-start !important; }
}

@media screen and (max-width: 600px) {
    .app-header-card { padding: 14px 16px; }
    .app-header-title h1 { font-size: 17px; }
    .btn-group .btn { width: 100% !important; }
}
