* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacMacFont, 'Segoe UI', sans-serif;
    background: #0f0f1e;
    position: relative;
    display: flex;
    flex-direction: column;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('Image/bg2.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 193, 7, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(233, 30, 99, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(76, 175, 80, 0.15) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

.header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: #112025;
    color: white;
    z-index: 100;
    flex-shrink: 0;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    text-align: left;
}

.main-layout-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    padding: 1rem;
    width: 100%;
    max-width: none;
    margin: 0;
    flex-grow: 1;
    overflow: hidden;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
    overflow: hidden;
}

.right-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.section {
    background: rgba(30, 30, 45, 0.6);
    backdrop-filter: blur(1.25rem);
    border: 0.0625rem solid rgba(255, 255, 255, 0.1);
    border-radius: 1.25rem;
    padding: 0;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-grow: 1;
}

.section-header {
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    letter-spacing: 0.03125rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
}

.student-count {
    font-size: 0.95rem;
    color: #4dabf7;
    font-weight: 700;
    margin-left: 0.25rem;
}

.section-header.dark {
    background: linear-gradient(135deg, #1e1e2e 0%, #27273a 100%);
}

.section-header.group-settings-header {
    background: #C55454;
}

.section-header.groups-output-main-header {
    background: linear-gradient(135deg, #1D64AE 0%, #17528a 100%);
}

.print-buttons {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.print-btn, .export-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 0.0625rem solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    color: white;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.print-btn:hover, .export-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-0.0625rem);
}

.print-btn:active, .export-btn:active {
    transform: scale(0.95);
}

.import-file-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 0.0625rem solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    color: white;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.import-file-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-0.0625rem);
}

.import-file-btn:active {
    transform: scale(0.95);
}

.toggle-add-menu-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 0.0625rem solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    color: white;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
}

.toggle-add-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-0.0625rem);
}

.toggle-add-menu-btn:active {
    transform: scale(0.95);
}

.groups-settings-section {
    min-height: auto;
    flex-grow: 0;
    flex-shrink: 0;
}

.groups-settings-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    gap: 1rem;
    flex-shrink: 0;
}

.settings-control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}

.settings-control-group label {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    text-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.5);
}

.settings-control-group #groupCountDisplay {
    display: inline-block;
    min-width: 1.5rem;
    text-align: center;
    font-size: 1.1rem;
    color: #4dabf7;
    font-weight: 700;
}

.group-slider {
    width: 100%;
    max-width: 200px;
    height: 0.5rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 0.5rem;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.group-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    background: linear-gradient(135deg, #4dabf7 0%, #3b8fd0 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0.125rem 0.5rem rgba(77, 171, 247, 0.5);
    transition: all 0.2s ease;
}

.group-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0.25rem 0.75rem rgba(77, 171, 247, 0.7);
}

.group-slider::-moz-range-thumb {
    width: 1.25rem;
    height: 1.25rem;
    background: linear-gradient(135deg, #4dabf7 0%, #3b8fd0 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0.125rem 0.5rem rgba(77, 171, 247, 0.5);
    transition: all 0.2s ease;
}

.group-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0.25rem 0.75rem rgba(77, 171, 247, 0.7);
}

.group-slider::-webkit-slider-runnable-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    height: 0.5rem;
}

.group-slider::-moz-range-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    height: 0.5rem;
}

.generate-btn, .clear-generated-btn {
    padding: 0.7rem 1.5rem;
    font-size: 0.95rem;
    width: 100%;
    max-width: 200px;
    margin-top: 0.5rem;
}

.generate-btn {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.2);
    text-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.5);
}

.generate-btn:hover {
    transform: translateY(-0.0625rem);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.3);
}

.generate-btn:active {
    transform: scale(0.98);
}

.clear-generated-btn {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 200px;
    text-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.5);
}

.clear-generated-btn:hover {
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    transform: translateY(-0.0625rem);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.3);
}

.clear-generated-btn:active {
    transform: scale(0.98);
}

.groups-output-section-all {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.dynamic-groups-grid {
    flex: 1;
    display: grid;
    gap: 1rem;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    align-content: start;
    scrollbar-width: thin;
    scrollbar-color: rgba(77, 171, 247, 0.5) transparent;
}

.dynamic-groups-grid::-webkit-scrollbar {
    width: 0.375rem;
}

.dynamic-groups-grid::-webkit-scrollbar-track {
    background: transparent;
}

.dynamic-groups-grid::-webkit-scrollbar-thumb {
    background: rgba(77, 171, 247, 0.5);
    border-radius: 0.625rem;
}

.dynamic-groups-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(77, 171, 247, 0.7);
}

.dynamic-groups-grid .placeholder-text {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    font-style: italic;
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

.group-card {
    background: rgba(77, 171, 247, 0.15);
    border: 0.0625rem solid rgba(77, 171, 247, 0.4);
    border-radius: 0.875rem;
    padding: 1.5rem;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 0.3125rem solid #4dabf7;
    min-width: 200px;
    height: auto;
    max-height: 350px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Bij 1-4 groepen: hogere kaarten zonder max-height */
.dynamic-groups-grid[style*="1fr"] .group-card,
.dynamic-groups-grid[style*="repeat(2"] .group-card,
.dynamic-groups-grid[style*="repeat(3"] .group-card,
.dynamic-groups-grid[style*="repeat(4"] .group-card {
    max-height: none;
    min-height: 400px;
}

/* Bij 5+ groepen: kleinere min-height zodat er 2 rijen passen zonder scrollen */
.dynamic-groups-grid[style*="repeat(4, 1fr)"] .group-card {
    max-height: none;
    min-height: 300px;
}

.group-card::-webkit-scrollbar {
    width: 0.375rem;
}

.group-card::-webkit-scrollbar-track {
    background: transparent;
}

.group-card::-webkit-scrollbar-thumb {
    background: rgba(77, 171, 247, 0.5);
    border-radius: 0.625rem;
}

.group-card::-webkit-scrollbar-thumb:hover {
    background: rgba(77, 171, 247, 0.7);
}

.group-card:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.375rem 1.25rem rgba(0, 0, 0, 0.4);
}

.group-card h3 {
    color: #4dabf7;
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
    border-bottom: 0.0625rem solid rgba(77, 171, 247, 0.3);
    padding-bottom: 0.5rem;
    text-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.group-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    flex-grow: 1;
}

.group-card ul li {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 0;
    font-size: 1rem;
    border-bottom: 0.0625rem dashed rgba(255, 255, 255, 0.1);
}

.group-card ul li:last-child {
    border-bottom: none;
}

.placeholder-text-small {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    text-shadow: none;
    margin: 0;
}

.students-management-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.students-management-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 1rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.students-list-column {
    flex: 0 1 auto;
    min-height: 100px;
    max-height: none;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.75rem;
    padding: 0.75rem;
    border: 0.0625rem solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.students-list-column::-webkit-scrollbar {
    width: 0.375rem;
}

.students-list-column::-webkit-scrollbar-track {
    background: transparent;
}

.students-list-column::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.625rem;
}

.students-list-column::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.current-students-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.student-list-item {
    background: rgba(255, 255, 255, 0.08);
    border: 0.0625rem solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    color: white;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.student-list-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.student-list-item.context-active {
    background: rgba(77, 171, 247, 0.2);
    border-color: rgba(77, 171, 247, 0.5);
}

.remove-tag-btn {
    background: rgba(255, 59, 48, 0.8);
    border: none;
    border-radius: 50%;
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.remove-tag-btn:hover {
    background: rgba(255, 59, 48, 1);
    transform: scale(1.1);
}

.students-add-options-column {
    display: none;
    flex-direction: column;
    gap: 1rem;
    flex-shrink: 0;
    width: 100%;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.manual-add-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.75rem;
    border: 0.0625rem solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    width: 100%;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.2);
}

.manual-add-name-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    align-items: center;
}

.manual-add-name-group input[type="text"] {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    border: 0.0625rem solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s ease;
}

.manual-add-name-group input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.manual-add-name-group input[type="text"]:focus {
    border-color: #4dabf7;
    background: rgba(0, 0, 0, 0.6);
}

.manual-add-block button, .clear-all-btn {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
    color: white;
    padding: 0.625rem 1.125rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.2);
    width: 100%;
    text-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.5);
}

.manual-add-block button:hover, .clear-all-btn:hover {
    transform: translateY(-0.0625rem);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.3);
}

.manual-add-block button:active, .clear-all-btn:active {
    transform: scale(0.98);
}

.clear-all-btn {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
    margin-top: 0.5rem;
}

.clear-all-btn:hover {
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
}

.custom-context-menu {
    display: none;
    position: fixed;
    background: rgba(30, 30, 45, 0.95);
    backdrop-filter: blur(0.625rem);
    border: 0.0625rem solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.5);
    z-index: 10000;
    overflow: hidden;
}

.context-menu-item {
    padding: 0.75rem 1.25rem;
    color: white;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.context-menu-item:hover {
    background: rgba(255, 59, 48, 0.8);
}

#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

#flyingNamesContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

#notificationContainer {
    position: fixed;
    top: 5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.notification {
    background: rgba(30, 30, 45, 0.95);
    backdrop-filter: blur(1rem);
    border: 0.125rem solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.5);
    animation: slideInDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), fadeOut 0.4s ease-in-out 2.6s forwards;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 90vw;
}

.notification.error {
    border-color: rgba(255, 59, 48, 0.6);
    background: rgba(255, 59, 48, 0.15);
}

.notification.warning {
    border-color: rgba(255, 193, 7, 0.6);
    background: rgba(255, 193, 7, 0.15);
}

.notification.success {
    border-color: rgba(76, 175, 80, 0.6);
    background: rgba(76, 175, 80, 0.15);
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}

.flying-name {
    position: absolute;
    background: linear-gradient(135deg, #4dabf7 0%, #3b8fd0 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 0.25rem 1rem rgba(77, 171, 247, 0.6);
    white-space: nowrap;
    opacity: 1;
    transition: all 1.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
}

/* Print styling */
@media print {
    body::before,
    body::after {
        display: none;
    }

    .header,
    .left-column,
    #confettiCanvas,
    #flyingNamesContainer,
    #notificationContainer,
    .custom-context-menu {
        display: none !important;
    }

    body {
        background: white;
        overflow: visible;
    }

    .main-layout-container {
        display: block;
        padding: 0;
        overflow: visible;
    }

    .right-column {
        overflow: visible;
        height: auto;
    }

    .section {
        background: white;
        border: none;
        box-shadow: none;
        overflow: visible;
        page-break-inside: avoid;
    }

    .section-header {
        background: #1D64AE !important;
        color: white;
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .print-buttons {
        display: none !important;
    }

    .dynamic-groups-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
        padding: 1rem;
        overflow: visible;
    }

    .group-card {
        background: white !important;
        border: 2px solid #333 !important;
        border-radius: 0.5rem;
        padding: 1rem;
        page-break-inside: avoid;
        overflow: visible;
        max-height: none;
        box-shadow: none;
    }

    .group-card h3 {
        color: #1D64AE !important;
        border-bottom: 2px solid #1D64AE !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .group-card ul li {
        color: #333 !important;
        border-bottom: 1px dashed #ccc !important;
    }

    .placeholder-text {
        display: none;
    }
}

@media (max-width: 992px) {
    .main-layout-container {
        grid-template-columns: 1fr;
        padding: 1rem 0.75rem;
        height: auto;
        min-height: auto;
    }

    .left-column {
        height: auto;
    }

    .right-column {
        height: auto;
    }

    .groups-settings-section,
    .students-management-section {
        min-height: auto;
    }

    .groups-settings-layout {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }

    .settings-control-group {
        width: auto;
    }

    .generate-btn, .clear-generated-btn {
        flex-grow: 1;
        min-width: 120px;
        max-width: none;
    }

    .dynamic-groups-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .students-management-layout {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        height: auto;
        min-height: auto;
    }

    .students-list-column {
        flex-grow: 1;
        margin-bottom: 0;
    }

    .students-add-options-column {
        width: 100%;
        max-width: 500px;
    }

    .current-students-grid {
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .main-layout-container {
        padding: 0.75rem 0.5rem;
        gap: 1rem;
    }

    .section-header {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    .groups-settings-layout {
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .settings-control-group {
        width: 100%;
        justify-content: center;
    }

    .settings-control-group label {
        font-size: 0.9rem;
    }

    .generate-btn, .clear-generated-btn {
        min-width: unset;
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }

    .dynamic-groups-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.75rem;
    }

    .group-card {
        padding: 1rem;
    }

    .group-card h3 {
        font-size: 1.2rem;
    }

    .group-card ul li {
        font-size: 0.9rem;
    }

    .placeholder-text-small {
        font-size: 0.9rem;
    }

    .students-management-layout {
        padding: 0.75rem;
    }

    .students-add-options-column {
        width: 100%;
    }

    .manual-add-block {
        padding: 0.75rem;
    }

    .manual-add-name-group input[type="text"] {
        font-size: 0.8125rem;
        padding: 0.5rem 0.75rem;
    }

    .manual-add-block button, .clear-all-btn {
        font-size: 0.8125rem;
        padding: 0.5rem 1rem;
    }

    .student-list-item .remove-tag-btn {
        font-size: 1.1rem;
    }
}