/* ============================================
   GEDRAGSPATROON TOOL - Styling
   ============================================ */

.gp-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 8px 0;
}

/* ---------- Student Select ---------- */
.gp-student-select {
    display: flex;
    justify-content: center;
}

.gp-student-select select {
    padding: 10px 16px;
    border: 2px solid #E8E8F0;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    background: var(--bg-white);
    cursor: pointer;
    min-width: 240px;
    transition: var(--transition);
}

.gp-student-select select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

/* ---------- Day Navigation ---------- */
.gp-day-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.gp-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #E8E8F0;
    background: var(--bg-white);
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.gp-nav-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #F5F4FF;
    transform: translateY(-1px);
}

.gp-nav-btn-sm {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.gp-day-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    min-width: 220px;
    text-align: center;
}

/* ---------- Legend ---------- */
.gp-legend {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.gp-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-medium);
}

.gp-legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.gp-legend-dot.good { background: #6BCB77; }
.gp-legend-dot.moderate { background: #FFB347; }
.gp-legend-dot.bad { background: #FF6B6B; }

.gp-legend-emoji {
    font-size: 20px;
    line-height: 1;
}

/* ---------- Day Chart ---------- */
.gp-day-chart {
    display: flex;
    gap: 0;
    min-height: 280px;
}

.gp-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 0;
    min-width: 90px;
    flex-shrink: 0;
}

.gp-y-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    text-align: right;
    padding-right: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 60px;
}

/* Chart area */
.gp-chart-area {
    flex: 1;
    position: relative;
    border-left: 2px solid #E8E8F0;
    border-bottom: 2px solid #E8E8F0;
    min-height: 240px;
}

/* Grid lines */
.gp-grid-lines {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
    padding: 20px 0;
}

.gp-grid-line {
    height: 0;
    border-top: 1px dashed #EDEDF2;
}

/* Columns container */
.gp-columns {
    position: absolute;
    inset: 0;
    display: flex;
    padding: 0;
}

/* Individual column */
.gp-chart-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Slots (3 per column, from top to bottom: good → moderate → bad) */
.gp-chart-slot {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
    z-index: 2;
}

.gp-chart-slot:hover {
    background: rgba(108, 99, 255, 0.06);
}

/* Marker */
.gp-chart-marker {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    position: relative;
    z-index: 3;
}

/* Color markers */
.gp-chart-marker.marker-good {
    background: #6BCB77;
    border: 3px solid #5AB868;
}

.gp-chart-marker.marker-moderate {
    background: #FFB347;
    border: 3px solid #E8A33E;
}

.gp-chart-marker.marker-bad {
    background: #FF6B6B;
    border: 3px solid #E85D5D;
}

/* Smiley markers */
.gp-chart-marker.marker-smiley {
    background: var(--bg-white);
    border: 3px solid #E8E8F0;
    font-size: 26px;
    line-height: 1;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

/* Marker pop animation */
@keyframes markerPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.gp-chart-marker.popping {
    animation: markerPop 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Connection line */
.gp-connection-line {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.gp-connection-line line {
    stroke: var(--primary);
    stroke-width: 2.5;
    stroke-linecap: round;
    opacity: 0.35;
}

/* X-axis labels */
.gp-x-axis {
    display: flex;
    margin-left: 90px;
    border-left: 2px solid transparent;
}

.gp-x-label {
    flex: 1;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-medium);
    padding: 10px 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Empty State ---------- */
.gp-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.gp-empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.gp-empty-state p {
    font-size: 16px;
    font-weight: 500;
}

.gp-empty-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 18px;
}

.gp-continue-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 560px;
    margin: 0 auto;
}

.gp-continue-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 2px solid var(--primary, #6C63FF);
    background: #fff;
    color: var(--primary, #6C63FF);
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .1s ease;
}

.gp-continue-chip:hover {
    background: var(--primary, #6C63FF);
    color: #fff;
}

.gp-continue-chip:active {
    transform: scale(.96);
}

.gp-continue-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6BCB77;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.gp-empty-sub {
    margin-top: 20px;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: var(--text-light);
}

/* ---------- Week Overview Section ---------- */
.gp-week-section {
    margin-top: 8px;
}

.gp-week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.gp-week-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gp-week-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0;
    min-width: 200px;
    text-align: center;
}

/* PDF button */
.gp-pdf-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.gp-pdf-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.3);
}

/* Week grid table */
.gp-week-grid-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.gp-week-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.gp-week-grid thead th {
    padding: 12px 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-light);
    border-bottom: 2px solid #E8E8F0;
    white-space: nowrap;
    text-align: center;
}

.gp-week-grid thead th:first-child {
    text-align: left;
    width: 100px;
    min-width: 80px;
}

.gp-week-grid tbody tr {
    transition: background 0.15s ease;
}

.gp-week-grid tbody tr:hover {
    background: #FAFAFF;
}

.gp-week-grid tbody tr.today {
    background: #EEEDFB;
}

.gp-week-grid tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid #F0F0F5;
    text-align: center;
    vertical-align: middle;
    height: 44px;
}

.gp-week-grid tbody td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 13px;
}

.gp-week-grid tbody tr.today td:first-child {
    color: var(--primary);
}

/* Week cell indicators */
.gp-week-cell {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.gp-week-cell.wc-good { background: #6BCB77; }
.gp-week-cell.wc-moderate { background: #FFB347; }
.gp-week-cell.wc-bad { background: #FF6B6B; }

.gp-week-cell.wc-smiley {
    background: transparent;
    font-size: 22px;
    line-height: 1;
}

.gp-week-cell.wc-empty {
    width: 12px;
    height: 12px;
    border: 2px dashed #E0E0EA;
    background: transparent;
}

/* ---------- Note Button on Marker ---------- */
.gp-note-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #E8E8F0;
    background: var(--bg-white);
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: var(--transition);
    padding: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.gp-note-btn:hover {
    border-color: var(--primary);
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.25);
}

.gp-note-btn.has-note {
    background: #FFF8E1;
    border-color: #FFB347;
}

/* ---------- Note Popup ---------- */
.gp-note-popup {
    position: fixed;
    z-index: 1000;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    border: 2px solid #E8E8F0;
    width: 280px;
    padding: 0;
    display: none;
    overflow: hidden;
}

.gp-note-popup.active {
    display: block;
}

.gp-note-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #F0F0F5;
    background: var(--bg-light);
}

.gp-note-popup-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
}

.gp-note-popup-close {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.gp-note-popup-close:hover {
    background: #FFE5E5;
    color: #FF6B6B;
}

.gp-note-input {
    width: 100%;
    border: none;
    padding: 12px 14px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-dark);
    resize: vertical;
    min-height: 60px;
    box-sizing: border-box;
}

.gp-note-input:focus {
    outline: none;
}

.gp-note-popup-actions {
    display: flex;
    justify-content: space-between;
    padding: 8px 14px 12px;
    gap: 8px;
}

.gp-note-save-btn {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.gp-note-save-btn:hover {
    background: var(--primary-dark);
}

.gp-note-delete-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    background: none;
    color: #FF6B6B;
    border: 1px solid #FFD4D4;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.gp-note-delete-btn:hover {
    background: #FFE5E5;
    border-color: #FF6B6B;
}

/* ---------- Week Cell Wrapper & Note Icon ---------- */
.gp-week-cell-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
}

.gp-week-note-icon {
    font-size: 14px;
    cursor: help;
    line-height: 1;
    flex-shrink: 0;
}

.gp-week-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #2D2B3D;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    max-width: 220px;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    pointer-events: none;
    line-height: 1.4;
}

.gp-week-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2D2B3D;
}

.gp-week-cell-wrapper:hover .gp-week-tooltip {
    display: block;
}

/* ---------- Settings: Segments List ---------- */
.gp-segments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.gp-segment-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gp-segment-item input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #E8E8F0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-dark);
    transition: var(--transition);
}

.gp-segment-item input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.gp-segment-remove {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-light);
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.gp-segment-remove:hover {
    background: #FFE5E5;
    color: #FF6B6B;
}

.gp-add-segment-btn {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    background: var(--bg-light);
    color: var(--primary);
    border: 2px dashed var(--primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.gp-add-segment-btn:hover {
    background: #F5F4FF;
    border-style: solid;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .gp-y-axis {
        min-width: 70px;
    }

    .gp-y-label {
        font-size: 11px;
        padding-right: 10px;
    }

    .gp-x-axis {
        margin-left: 70px;
    }

    .gp-x-label {
        font-size: 10px;
    }

    .gp-chart-marker {
        width: 36px;
        height: 36px;
    }

    .gp-chart-marker.marker-smiley {
        font-size: 20px;
    }

    .gp-week-header {
        flex-direction: column;
        align-items: stretch;
    }

    .gp-week-nav {
        justify-content: center;
    }

    .gp-pdf-btn {
        align-self: center;
    }
}

@media (max-width: 600px) {
    .gp-day-label {
        font-size: 15px;
        min-width: 160px;
    }

    .gp-y-axis {
        min-width: 55px;
    }

    .gp-y-label {
        font-size: 10px;
        padding-right: 8px;
    }

    .gp-x-axis {
        margin-left: 55px;
    }

    .gp-x-label {
        font-size: 9px;
        padding-top: 6px;
    }

    .gp-chart-marker {
        width: 30px;
        height: 30px;
    }

    .gp-chart-marker.marker-smiley {
        font-size: 16px;
    }

    .gp-day-chart {
        min-height: 220px;
    }

    .gp-legend {
        gap: 12px;
    }

    .gp-legend-item {
        font-size: 12px;
    }

    .gp-week-grid thead th {
        padding: 8px 6px;
        font-size: 10px;
    }

    .gp-week-grid tbody td {
        padding: 6px 4px;
    }

    .gp-week-cell {
        width: 26px;
        height: 26px;
    }

    .gp-week-cell.wc-smiley {
        font-size: 18px;
    }
}
