/* Temel Stiller */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif;
}

body {
    line-height: 1.6;
    padding: 10px;
}

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

@media (min-width: 768px) {
    .container {
        max-width: 100%;
        padding: 20px;
    }
}

/* Başlık Stilleri */
.header {
    text-align: center;
    margin: 20px auto;
    max-width: 900px;
    padding: 0 10px;
}

.header h1 {
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: bold;
}

.header h2 {
    font-size: 16px;
    font-weight: bold;
}

/* Settings Panel Stilleri */
.settings-panel {
    background-color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.settings-panel h3 {
    margin-bottom: 15px;
    color: #333;
}

/* Modern 3D Input Stilleri */
input {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    background: #f8f9fa;
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.1),
                inset -2px -2px 5px rgba(255,255,255,0.9),
                2px 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    color: #2c3e50;
}

input:focus {
    outline: none;
    background: #fff;
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.1),
                inset -1px -1px 3px rgba(255,255,255,0.9),
                0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Tablo içindeki input stilleri */
.table-input {
    width: 40px;
    padding: 2px 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 10px;
    text-align: center;
    background: #fff;
    box-shadow: none;
    transition: all 0.2s ease;
    -moz-appearance: textfield; /* Firefox'ta okları kaldır */
    appearance: textfield;
}

/* Chrome, Safari, Edge, Opera'da number input oklarını kaldır */
.table-input::-webkit-inner-spin-button,
.table-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.table-input:focus {
    border-color: #e74c3c;
    outline: none;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.1);
    background: #fff;
}

/* Modern 3D Buton Stilleri */
.btn-3d {
    position: relative;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(145deg, #ff5544, #e74c3c);
    color: white;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3),
                0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
    overflow: hidden;
}

.btn-3d:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4),
                0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-3d:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3),
                0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-print {
    background: linear-gradient(145deg, #3ea1e6, #3498db);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3),
                0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-save {
    background: linear-gradient(145deg, #2ecc71, #27ae60);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3),
                0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 8px 16px;
    font-size: 13px;
}

.btn-cancel {
    background: linear-gradient(145deg, #95a5a6, #7f8c8d);
    box-shadow: 0 4px 15px rgba(127, 140, 141, 0.3),
                0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 8px 16px;
    font-size: 13px;
}

/* Düzenle butonu */
.btn-edit {
    background: linear-gradient(145deg, #2e86de, #2874c4);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3),
                0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.btn-edit:hover {
    background: linear-gradient(145deg, #2874c4, #2466b0);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4),
                0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Modal Stilleri */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
    z-index: 1000;
}

.modal-content.red-theme {
    background-color: white;
    padding: 15px;
    border-radius: 10px;
    width: 95%;
    max-width: 500px;
    margin: 20px auto;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-top: 5px solid #e74c3c;
}

.modal-header {
    background-color: #e74c3c;
    margin: -15px -15px 15px -15px;
    padding: 12px 15px;
    border-radius: 10px 10px 0 0;
}

.modal-header h2 {
    color: white;
    margin: 0;
    font-size: 1.3em;
}

.grade-section {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
}

.grade-section h3 {
    color: #e74c3c;
    margin-bottom: 8px;
    font-size: 1em;
}

/* Form Stilleri */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.form-group {
    margin-bottom: 5px;
}

.form-group label {
    display: block;
    margin-bottom: 2px;
    color: #555;
    font-size: 0.8em;
}

/* Tablo Stilleri */
.table-container {
    margin: 20px 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: 100%;
    overflow-x: auto;
}

.table-wrapper {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    table-layout: auto;
}

/* Ana başlıklar için stil */
.section-header {
    background-color: #f4f4f4;
    color: black;
    font-weight: bold;
    padding: 4px 2px;
    text-align: center;
    font-size: 9px;
}

/* Alt başlıklar için stil */
tr.subheader th {
    background-color: #f9f9f9;
    font-size: 8px;
    padding: 4px 2px;
    height: 30px;
}

/* Zebra çizgili satırlar */
tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

th, td {
    border: 1px solid #000;
    padding: 3px;
    text-align: center;
    font-size: 9px;
}

th {
    font-weight: bold;
    color: #333;
}

.small-header {
    font-size: 8px;
    padding: 2px;
    line-height: 1.2;
}

/* Bölüm Ayırıcıları */
.border-right {
    border-right: 2px solid #000 !important;
}

/* Footer Stilleri */
.footer {
    text-align: right;
    margin-top: 20px;
    padding-right: 20px;
}

.teacher-name {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
}

.teacher-title {
    font-size: 12px;
}

/* Yazdırma Stilleri */
@media print {
    @page {
        size: A4 landscape;
        margin: 10mm;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    body {
        padding: 0;
        background: white;
        margin: 0;
    }

    .container {
        padding: 0;
        margin: 0;
        max-width: 100%;
    }

    .settings-panel,
    .controls, 
    .btn,
    .btn-edit,
    .print\:hidden {
        display: none !important;
    }

    /* Yazdırmada input değerlerini göster */
    .table-input {
        border: none !important;
        background: transparent !important;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        appearance: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: auto !important;
        font-size: 7pt !important;
        color: black !important;
    }

    .header {
        margin: 0 0 10px 0;
        padding: 0;
    }

    .header h1 {
        font-size: 12pt;
        margin-bottom: 3pt;
    }

    .header h2 {
        font-size: 10pt;
    }

    .table-container {
        box-shadow: none !important;
        margin: 0;
        background: none;
        border-radius: 0;
        padding: 0;
    }

    .table-wrapper {
        overflow: visible !important;
    }

    table {
        font-size: 7pt;
        border: 2px solid #000 !important;
        border-collapse: collapse;
        width: 100%;
        margin: 0;
    }

    th, td {
        border: 1px solid #000 !important;
        padding: 2px !important;
        font-size: 7pt !important;
        line-height: 1.2;
    }

    th {
        font-weight: bold;
        background-color: #f4f4f4 !important;
    }

    /* Ana başlıklar */
    .section-header {
        background-color: #e0e0e0 !important;
        font-weight: bold;
        font-size: 8pt !important;
        border: 1px solid #000 !important;
    }

    /* Alt başlıklar */
    tr.subheader th {
        background-color: #f0f0f0 !important;
        font-size: 7pt !important;
        padding: 3px 2px !important;
    }

    .small-header {
        font-size: 6pt !important;
    }

    .small-header .percentage {
        font-size: 6pt !important;
        display: block;
    }

    /* Zebra çizgili satırlar */
    tbody tr:nth-child(even) {
        background-color: #fafafa !important;
    }

    tbody tr:nth-child(odd) {
        background-color: white !important;
    }

    /* Kalın kenarlıklar */
    .border-right {
        border-right: 2px solid #000 !important;
    }

    .footer {
        margin-top: 10px;
        padding: 0;
        font-size: 9pt;
        text-align: right;
    }

    .teacher-name {
        font-size: 10pt;
        margin-bottom: 2px;
    }

    .teacher-title {
        font-size: 9pt;
    }

    /* Hücre içeriğinin kesilmemesi için */
    td, th {
        white-space: nowrap;
        overflow: visible !important;
    }

    /* Satır sonlarının kesilmemesi */
    tr {
        page-break-inside: avoid;
    }

    /* Tablo başlığının sayfada kalması */
    thead {
        display: table-header-group;
    }

    /* Son sütunun görünmesi için */
    table tr td:last-child,
    table tr th:last-child {
        border-right: 1px solid #000 !important;
    }

    /* Alt satırın görünmesi için */
    table tr:last-child td,
    table tr:last-child th {
        border-bottom: 1px solid #000 !important;
    }

    /* Tablonun dış çerçevesi */
    table {
        outline: 2px solid #000;
    }
}

/* Modal Açık/Kapalı Durumu */
.modal.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* Mobil Uyumluluk */
@media (max-width: 768px) {
    .modal-content.red-theme {
        margin: 10px;
        padding: 10px;
    }

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

    input {
        padding: 12px;
        font-size: 16px;
    }

    .btn-3d {
        padding: 12px 20px;
        font-size: 14px;
    }

    .table-input {
        width: 35px;
        font-size: 9px;
        padding: 1px 2px;
    }
}

/* Import modal stilleri */
.import-content {
    padding: 15px 0;
}

.import-info {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

#importData {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: monospace;
    resize: vertical;
    background: #f8f9fa;
    margin-bottom: 15px;
}

.btn-import {
    background: linear-gradient(145deg, #27ae60, #2ecc71);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3),
                0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Sınıf yönetimi stilleri */
.class-management {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.class-add-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.class-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.class-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.class-name {
    background: linear-gradient(145deg, #4cd137, #44bd32);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.class-name.active {
    background: linear-gradient(145deg, #44bd32, #3da82c);
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.1);
}

.btn-clear {
    background: linear-gradient(145deg, #ff9f43, #e68a39);
    color: white;
}

.btn-clear:hover {
    background: linear-gradient(145deg, #e68a39, #cc7a33);
}

.btn-delete {
    background: linear-gradient(145deg, #ff6b6b, #ee5253);
}

/* Mobil uyumluluk */
@media (max-width: 768px) {
    .class-add-group {
        flex-direction: column;
    }
    
    .class-tab {
        width: 100%;
    }
}

/* Sınıf yönetimi buton stilleri */
.class-tab .btn-edit,
.class-tab .btn-delete {
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    min-width: unset;
    border-radius: 6px;
}

.class-tab .btn-edit {
    background: linear-gradient(145deg, #2e86de, #2874c4);
    color: white;
}

.class-tab .btn-edit:hover {
    background: linear-gradient(145deg, #2874c4, #2466b0);
}

.class-tab .btn-delete {
    background: linear-gradient(145deg, #ff6b6b, #ee5253);
    color: white;
    font-size: 20px;
}

.class-tab .btn-delete:hover {
    background: linear-gradient(145deg, #ee5253, #d63031);
}
