/* LGS Puan Hesaplama CSS - Compact Excel Style */

.lgs-hesaplama-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    width: fit-content;
    /* Container shrinks to fit table */
    min-width: 320px;
    margin: 20px 0;
    /* Align left by default, or 0 auto to center */
    background-color: #fff;
    padding: 0;
}

/* Table Structure */
.lgs-table-responsive {
    overflow-x: auto;
    border: 1px solid #ccc;
    display: inline-block;
    /* Wraps table tightly */
}

.lgs-table {
    width: auto;
    /* Table shrinks to content width */
    border-collapse: collapse;
    font-size: 14px;
    color: #333;
}

/* Header */
.lgs-table thead th {
    background-color: #e6e6e6;
    color: #000;
    font-weight: bold;
    text-align: center;
    padding: 8px 10px;
    /* Reduced padding */
    border: 1px solid #bfbfbf;
    white-space: nowrap;
    /* Prevent headers from wrapping awkwardly */
}

/* Rows & Zebra Striping */
.lgs-table tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

.lgs-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

/* Cells */
.lgs-table td {
    padding: 6px 5px;
    /* Compact padding */
    border: 1px solid #d9d9d9;
    text-align: center;
    vertical-align: middle;
}

/* Column Specifics */
.lgs-lesson {
    text-align: left !important;
    padding-left: 10px !important;
    font-weight: 600;
    color: #444;
    white-space: nowrap;
    width: 1%;
    /* Trick to make it take minimum necessary width */
    min-width: 140px;
    /* But at least this wide */
}

/* Inputs */
.lgs-input {
    width: 50px;
    /* Narrower inputs */
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 2px;
    text-align: center;
    font-size: 14px;
}

.lgs-input:focus {
    border-color: #217346;
    outline: none;
    box-shadow: 0 0 2px rgba(33, 115, 70, 0.5);
}

/* Readonly fields */
.lgs-bos,
.lgs-net,
.lgs-katki {
    font-weight: 500;
    color: #000;
    min-width: 40px;
    display: inline-block;
}

/* LGS Footer (Button & Result Side-by-Side) */
.lgs-footer {
    display: flex;
    align-items: center;
    margin-top: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.lgs-actions {
    margin: 0;
    padding: 0;
}

/* Button Styles (Restored) */
.lgs-btn {
    padding: 10px 25px;
    font-size: 15px;
    cursor: pointer;
    border: 1px solid #adadad;
    border-radius: 4px;
    background-color: #e1e1e1;
    color: #333;
    font-weight: bold;
    transition: all 0.2s;
}

.lgs-btn:hover {
    background-color: #d4d4d4;
    border-color: #8c8c8c;
}

/* Result Box Style */
.lgs-result-wrapper {
    margin: 0;
    padding: 10px 20px;
    background-color: #fff3cd;
    /* Light yellow/orange box */
    border: 1px solid #ffeeba;
    border-radius: 6px;
    width: auto;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
}

.lgs-result-text {
    font-size: 18px;
    color: #856404;
    /* Darker yellow/brown text */
    font-weight: 700;
    white-space: nowrap;
}

#lgs-toplam-puan {
    color: #d35400;
    /* Burnt orange for the score number */
    font-size: 24px;
    font-weight: 800;
    margin-left: 8px;
}

.lgs-disclaimer {
    font-size: 11px;
    color: #666;
    margin-top: 3px;
}

/* LGS Title Style */
.lgs-title {
    text-align: left;
    color: #444;
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: 600;
}

/* Mobile Responsiveness - Card Layout */
/* Mobile Responsiveness - Card Layout */
@media screen and (max-width: 768px) {
    .lgs-hesaplama-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 10px 0;
        box-sizing: border-box;
    }

    /* Force table to not be like tables anymore */
    .lgs-table-responsive {
        border: none;
        display: block;
        width: 100%;
        overflow-x: visible;
    }

    .lgs-table,
    .lgs-table tbody,
    .lgs-table th,
    .lgs-table td,
    .lgs-table tr {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Hide table headers completely */
    .lgs-table thead {
        display: none !important;
    }

    /* Card Container for each Lesson */
    .lgs-table tr {
        margin-bottom: 20px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        background-color: #fff;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        padding: 15px;
        display: flex !important;
        flex-direction: column;
    }

    /* Rows inside the Card */
    .lgs-table td {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        text-align: left !important;
        padding: 10px 0 !important;
        border: none;
        border-bottom: 1px solid #eee;
        min-height: auto;
    }

    .lgs-table td:last-child {
        border-bottom: 0;
    }

    /* Labels matching the screenshot */
    .lgs-table td:before {
        content: attr(data-label);
        display: block;
        font-weight: 700;
        color: #333;
        font-size: 14px;
        margin-bottom: 5px;
        width: 100%;
        text-align: left;
    }

    /* Lesson Name Specifics */
    .lgs-table td.lgs-lesson {
        padding-top: 5px !important;
        padding-bottom: 15px !important;
        background-color: transparent;
        color: #217346;
        font-weight: 700;
        border-bottom: 2px solid #217346;
        margin-bottom: 10px;
        font-size: 18px;
        white-space: normal !important;
    }

    /* Hide the 'Ders Adı' label for the lesson name itself so it looks like a card title */
    .lgs-table td.lgs-lesson:before {
        display: none;
    }

    /* Inputs - Full width like in screenshot */
    .lgs-input {
        width: 100% !important;
        max-width: 100%;
        box-sizing: border-box;
        height: 40px;
        /* Taller touch target */
        font-size: 16px;
        /* Prevent IOS zoom */
        padding: 8px;
        border: 1px solid #ccc;
        border-radius: 4px;
        margin: 0;
        text-align: left;
    }

    /* Results - Left aligned text */
    .lgs-bos,
    .lgs-net,
    .lgs-katki {
        display: block;
        text-align: left;
        width: 100%;
        font-weight: 500;
        color: #555;
        min-width: 0;
    }

    /* Footer adjustments */
    .lgs-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .lgs-actions {
        width: 100%;
    }

    .lgs-btn {
        width: 100%;
        padding: 15px;
        background-color: #217346;
        color: white;
        border: none;
        font-size: 16px;
        border-radius: 6px;
    }

    .lgs-btn:hover {
        background-color: #1e6b41;
    }

    .lgs-result-wrapper {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
        margin-top: 0;
        background-color: #f8f9fa;
        border: 1px solid #dee2e6;
    }
}