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

body {
    font-family: Arial, sans-serif;
    line-height: 1.4;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main-title {
    color: #333;
    text-align: center;
    margin-bottom: 5px;
    font-size: 12pt;
    line-height: 1.2;
}

.book-title {
    color: #333;
    text-align: center;
    margin-bottom: 10px;
    font-size: 12pt;
    font-weight: bold;
}

.form-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.title-group,
.book-titles-group,
.student-info-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.title-group {
    flex-direction: column;
}

.book-titles-group {
    justify-content: flex-start;
}

.student-info-group {
    align-items: center;
}

.input-long {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.input-medium {
    flex: 2;
    min-width: 200px;
    max-width: 300px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.input-short {
    flex: 1;
    min-width: 120px;
    max-width: 150px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.button-group {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    background: #f0f0f0;
    color: #666;
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

button:active {
    box-shadow: inset 5px 5px 10px #d1d1d1,
                inset -5px -5px 10px #ffffff;
}

.add-btn {
    background: #4cd137;
    color: white;
}

.add-btn:hover {
    background: #44bd32;
}

.print-btn {
    background: #2e86de;
    color: white;
}

.print-btn:hover {
    background: #2874c4;
}

.clear-btn {
    background: #ff9f43;
    color: white;
}

.clear-btn:hover {
    background: #e68a39;
}

.edit-criteria-btn {
    background: #a55eea;
    color: white;
}

.edit-criteria-btn:hover {
    background: #8854c9;
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    max-width: 297mm; /* A4 yatay genişlik */
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    table-layout: fixed;
}

th, td {
    border: 1px solid #ddd;
    padding: 4px;
    text-align: center;
    vertical-align: middle;
    height: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

th {
    background: #f8f9fa;
    font-weight: bold;
}

.criteria-header {
    background: #e9ecef;
    font-size: 12pt;
    font-weight: bold;
    padding: 4px;
}

.criteria-row th {
    font-size: 10px;
    background: #e9ecef;
    width: 7.7%;
    height: auto;
    min-height: 40px;
    white-space: normal;
    line-height: 1.1;
    padding: 2px;
}

.number-header {
    width: 5.5%;
    background: #f8f9fa;
    font-size: 11px;
}

.name-header {
    width: 8%;
    background: #f8f9fa;
    font-size: 11px;
}

.total-header {
    width: 5%;
    background: #f8f9fa;
    font-size: 11px;
}

.edit-btn {
    background: #2e86de;
    color: white;
    padding: 4px 8px;
    font-size: 11px;
    margin-right: 4px;
    flex: none;
}

.edit-btn:hover {
    background: #1976D2;
}

.delete-btn {
    background: #ff6b6b;
    color: white;
    padding: 4px 8px;
    font-size: 11px;
    flex: none;
}

.delete-btn:hover {
    background: #c82333;
}

/* Popup temel stilleri - Modern ve Sade */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 999;
    justify-content: center;
    align-items: center;
}

/* Popup aktif olduğunda */
.popup-overlay.active {
    display: flex;
}

.popup {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    min-width: 300px;
    max-width: 500px;
    width: 90%;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.popup-header h3 {
    font-size: 18px;
    color: #333;
    margin: 0;
}

.popup-close {
    width: 28px;
    height: 28px;
    background: #f5f5f5;
    border: none;
    border-radius: 6px;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.popup-close:hover {
    background: #ff4444;
    color: white;
}

.popup-content input,
.popup-content textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
    margin-bottom: 15px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.popup-content input:focus,
.popup-content textarea:focus {
    outline: none;
    border-color: #4cd137;
    background: #fff;
}

.popup-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.popup-save,
.popup-cancel {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.popup-save {
    background: #4cd137;
    color: white;
}

.popup-cancel {
    background: #ff6b6b;
    color: white;
}

.popup-save:hover,
.popup-cancel:hover {
    opacity: 0.9;
}

/* Mobil için medya sorguları */
@media screen and (max-width: 768px) {
    body {
        padding: 5px;
        -webkit-text-size-adjust: 100%; /* iOS font boyutu düzeltmesi */
    }

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

    /* Form container düzenlemeleri */
    .form-container {
        padding: 12px;
        gap: 12px;
    }

    .title-group,
    .book-titles-group,
    .student-info-group,
    .button-group {
        flex-direction: column;
        gap: 8px;
    }

    /* Input alanları */
    .input-long,
    .input-medium,
    .input-short {
        width: 100%;
        max-width: none;
        min-width: unset;
        padding: 10px;
        font-size: 16px; /* iOS için minimum font boyutu */
        margin-bottom: 8px;
    }

    /* Butonlar */
    button {
        width: 100%;
        padding: 12px;
        font-size: 16px;
        min-height: 44px; /* iOS için minimum dokunma alanı */
        margin-bottom: 5px;
    }

    /* Tablo düzenlemeleri */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -10px;
        padding: 0 10px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 6px 4px;
        white-space: nowrap;
    }

    .edit-btn, 
    .delete-btn {
        padding: 8px;
        font-size: 12px;
        min-width: 60px;
    }

    /* Sınıf yönetimi */
    .class-management {
        padding: 12px;
        margin: 10px 0;
    }

    .class-add-group {
        flex-direction: column;
        gap: 8px;
    }

    .class-tabs {
        flex-direction: column;
        gap: 8px;
    }

    .class-tab {
        width: 100%;
        padding: 6px;
    }

    .class-name {
        flex: 1;
        font-size: 14px;
        padding: 10px 15px;
    }

    .class-edit-btn, 
    .class-delete-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    /* Popup düzenlemeleri */
    .popup {
        width: 92%;
        margin: 10px;
        padding: 15px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .popup-header {
        padding-bottom: 10px;
        margin-bottom: 15px;
    }

    .popup-header h3 {
        font-size: 16px;
    }

    .popup-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }

    .popup-content input,
    .popup-content textarea {
        font-size: 16px;
        padding: 10px;
    }
}

/* Excel popup için özel stiller */
.excel-popup {
    max-width: 600px;
}

.excel-instructions {
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4cd137;
}

.excel-instructions h4 {
    color: #333;
    margin-bottom: 8px;
    font-size: 16px;
}

.excel-instructions ul {
    padding-left: 20px;
}

.excel-instructions li {
    margin-bottom: 5px;
    font-size: 14px;
    color: #555;
}

#excelText {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: monospace;
    resize: vertical;
}

/* Kriterleri düzenleme popup için stiller */
.criteria-popup {
    max-width: 700px;
}

.criteria-content {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 15px;
}

.criteria-input-group {
    margin-bottom: 15px;
}

.criteria-input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #444;
}

.criteria-input-group textarea {
    width: 100%;
    height: 80px;
    resize: vertical;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

/* Yazdırma özel stilleri */
@media print {
    body {
        background: white;
        padding: 0;
        font-size: 10pt;
    }
    
    .container {
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }
    
    .form-container,
    .button-group,
    .class-management,
    .no-print {
        display: none !important;
    }
    
    .table-responsive {
        overflow: visible;
        margin: 0 0 1cm;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    table {
        border-collapse: collapse;
        width: 100%;
    }
    
    th, td {
        border: 1pt solid black;
        padding: 3pt;
        font-size: 9pt;
    }
    
    .criteria-row th {
        font-size: 8pt;
        padding: 2pt;
    }
    
    .main-title {
        font-size: 14pt;
        margin-top: 0.5cm;
    }
    
    .book-title {
        font-size: 12pt;
        margin: 0.3cm 0;
    }
}

/* Sınıf yönetimi stilleri */
.class-management {
    background: #f0f0f0;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

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

.class-select-group {
    margin-bottom: 10px;
    width: 100%;
}

/* Açılır menü (select) özel stilleri */
#classSelect {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #4cd137;
    border-radius: 8px;
    background-color: #fff;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234cd137' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

#classSelect:hover {
    border-color: #44bd32;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#classSelect:focus {
    outline: none;
    border-color: #2e86de;
    box-shadow: 0 0 0 3px rgba(46, 134, 222, 0.2);
}

.selected-class-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #4cd137 0%, #44bd32 100%);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-left: 5px solid #2e86de;
}

.selected-class-info:hover {
    box-shadow: 0 5px 10px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.selected-class-buttons {
    display: flex;
    gap: 8px;
}

#selectedClassName {
    font-weight: 600;
    font-size: 18px;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Animasyon Efekti */
@keyframes highlight {
    0% {
        transform: scale(1);
        box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    }
}

.highlight-effect {
    animation: highlight 0.5s ease;
}

.class-tab {
    display: flex;
    align-items: center;
}

.class-name {
    background: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 8px 0 0 8px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    flex: none;
}

.class-name.active {
    background: #4cd137;
    color: white;
    font-weight: bold;
}

.class-name:hover {
    background: #d4d4d4;
}

.class-name.active:hover {
    background: #44bd32;
}

.class-edit-btn,
.class-delete-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    color: white;
    transition: all 0.3s ease;
    flex: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.class-edit-btn {
    background: #2e86de;
}

.class-delete-btn {
    background: #ff6b6b;
}

.class-edit-btn:hover {
    background: #1b6dc5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.class-delete-btn:hover {
    background: #ff4757;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Excel buton stili */
.excel-btn {
    background: #1fa463;
    color: white;
}

.excel-btn:hover {
    background: #168f56;
}