@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Rubik', sans-serif;
    background: #121212;
    min-height: 100vh;
    color: #e0e0e0;
    padding-top: 80px;
}

a {
  text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(40, 40, 40, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-left {
    text-align: left;
}

.header-left h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #ffffff;
}

.description {
    font-size: 0.85rem;
    color: #b0b0b0;
    margin-top: 4px;
    letter-spacing: 0.3px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(51, 51, 51, 0.6);
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid rgba(68, 68, 68, 0.4);
}

.header-link:hover {
    background: rgba(68, 68, 68, 0.6);
    transform: translateY(-2px);
}

.header-link i {
    color: #ffffff;
    font-size: 1.2rem;
}

.logo-img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.main-content {
    background: #1e1e1e;
    border-radius: 8px;
    border: 1px solid #333;
    overflow: hidden;
}

.file-section,
.group-section {
    padding: 24px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.mobile-save-section {
    display: none;
    padding: 20px 24px 24px;
    justify-content: center;
    align-items: center;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

#fileLabel {
    font-weight: 500;
    font-size: 0.95rem;
    color: #e0e0e0;
}

#studentInfo {
    color: #888;
    font-size: 0.8rem;
}

.group-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.action-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.group-controls label {
    font-weight: 500;
    color: #b0b0b0;
    font-size: 0.85rem;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    font-size: 0.85rem;
    color: #b0b0b0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #6c757d;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #198754;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.btn-group {
    position: relative;
    display: inline-flex;
}

.btn-group-main {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.btn-group-dropdown {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 10px 12px;
    min-width: auto;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2a2a2a;
    border: 1px solid #444;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 4px;
    min-width: 160px;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #e0e0e0;
    border-bottom: 1px solid #333;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #3a3a3a;
}

.dropdown-item:first-child {
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.dropdown-item:last-child {
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}

.dropdown-item i {
    font-size: 0.8rem;
    color: #b0b0b0;
}

.btn {
    padding: 10px 18px;
    border: 1px solid transparent;
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

#saveBtn {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

#saveDropdownBtn{
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

#selectFileBtn, #createGroupsBtn, #clearFileBtn {
    border-radius: 6px;
}

#clearFileBtn {
    background: #dc3545;
    color: white;
    padding: 10px 12px;
}

#clearFileBtn:hover {
    background: #c5303f;
}

.btn:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn i {
    font-size: 0.9rem;
    color: inherit;
}

.btn-primary {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background: #0b5ed7;
    border-color: #0b5ed7;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background: #5c636a;
    border-color: #5c636a;
}

.btn-success {
    background: #198754;
    color: white;
    border-color: #198754;
}

.btn-success:hover {
    background: #157347;
    border-color: #157347;
}

.btn-group-main {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.btn-group-dropdown {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.number-input-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    overflow: hidden;
}

.modern-number-input {
    padding: 8px 12px;
    border: none;
    font-family: 'Rubik', sans-serif;
    font-size: 0.85rem;
    background: transparent;
    color: #e0e0e0;
    width: 60px;
    -moz-appearance: textfield;
}

.modern-number-input:focus {
    outline: none;
}

.modern-number-input::-webkit-outer-spin-button,
.modern-number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.number-controls {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-left: 1px solid #444;
}

.number-up, .number-down {
    background: transparent;
    border: none;
    color: #b0b0b0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50%;
    width: 24px;
    transition: background-color 0.2s ease;
}

.number-up:hover, .number-down:hover {
    background: #3a3a3a;
}

.number-up i, .number-down i {
    font-size: 0.6rem;
}

.table-section {
    padding: 0;
    max-height: 400px;
    overflow: hidden;
}

.table-container {
    max-height: 400px;
    overflow-y: auto;
    border-top: 1px solid #333;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

thead {
    background: #2a2a2a;
    color: #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #444;
}

th,
td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #333;
}

th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}

tbody tr {
    background: #1e1e1e;
    color: #e0e0e0;
}

tbody tr:hover {
    background-color: #2a2a2a;
}

tbody tr:nth-child(even) {
    background-color: #252525;
}

tbody tr:nth-child(even):hover {
    background-color: #2a2a2a;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 280px;
    font-size: 0.8rem;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #0f5132;
    color: #d1e7dd;
    border: 1px solid #198754;
}

.notification.error {
    background: #842029;
    color: #f8d7da;
    border: 1px solid #dc3545;
}

.notification.warning {
    background: #664d03;
    color: #fff3cd;
    border: 1px solid #ffc107;
}

.mobile-dropup {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 4px;
    transform: translateY(10px);
}

.mobile-dropup.show {
    transform: translateY(0);
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
    
    .header {
        padding: 10px 0;
    }
    
    .header-content {
        gap: 15px;
        padding: 0 10px;
    }
    
    .header-left h1 {
        font-size: 1.5rem;
    }
    
    .description {
        font-size: 0.75rem;
    }
    
    .header-right {
        gap: 12px;
    }
    
    .header-link {
        width: 36px;
        height: 36px;
    }
    
    .header-link i {
        font-size: 1.1rem;
    }
    
    .logo-img {
        width: 20px;
        height: 20px;
    }
    
    .file-section,
    .group-section {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 18px;
        gap: 15px;
    }
    
    .file-controls {
        justify-content: center;
    }
    
    .group-controls {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .action-controls {
        justify-content: center;
        flex-direction: column;
        gap: 15px;
    }
    
    .toggle-container {
        order: 1;
        margin-bottom: 10px;
    }
    
    #createGroupsBtn {
        order: 2;
    }
    
    .action-controls .btn-group {
        display: none;
        order: 3;
    }
    
    .mobile-save-section {
        display: flex;
    }
    
    .mobile-btn-group {
        width: 100%;
        justify-content: center;
    }
    
    .btn-group-main {
        flex: 1;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 0.8rem;
        justify-content: center;
    }
    
    .number-input-container {
        min-width: 100px;
        text-align: center;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .table-section {
        max-height: 350px;
    }
    
    .table-container {
        max-height: 350px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 95px;
    }
    
    .header-left h1 {
        font-size: 1.3rem;
    }
    
    .description {
        font-size: 0.7rem;
    }
    
    .btn {
        padding: 10px 14px;
        font-size: 0.75rem;
    }
    
    .file-section,
    .group-section,
    .mobile-save-section {
        padding: 15px;
    }
    
    .mobile-save-section {
        padding: 15px 15px 20px;
    }
    
    .table-section {
        max-height: 300px;
    }
    
    .table-container {
        max-height: 300px;
    }
}