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

:root {
    --pastel-purple: #E8D5F2;
    --pastel-blue: #D5E8F2;
    --pastel-pink: #F2D5E8;
    --pastel-green: #D5F2E8;
    --pastel-yellow: #F2ECD5;
    --pastel-peach: #F2DFD5;
    
    --primary: #9B7EBD;
    --secondary: #7EB8BD;
    --accent: #BD7E9B;
    --success: #7EBD9B;
    --warning: #BDA87E;
    --danger: #BD7E7E;
    
    --text-dark: #4a4a4a;
    --text-light: #6b6b6b;
    --border: #e0e0e0;
    --bg-light: #fafafa;
    --white: #ffffff;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--pastel-purple) 0%, var(--pastel-blue) 100%);
    min-height: 100vh;
    color: var(--text-dark);
}

/* Admin Container */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--white);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 600;
}

.sidebar-header i {
    margin-right: 8px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.nav-item i {
    margin-right: 12px;
    font-size: 18px;
    width: 20px;
}

.nav-item:hover {
    background: var(--pastel-purple);
    border-left-color: var(--primary);
}

.nav-item.active {
    background: var(--pastel-purple);
    border-left-color: var(--primary);
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 40px;
}

.content-header {
    margin-bottom: 40px;
}

.content-header h1 {
    font-size: 32px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.content-header p {
    color: var(--text-light);
    font-size: 16px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--white);
}

.stat-info h3 {
    font-size: 28px;
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--text-light);
    font-size: 14px;
}

/* Tests Section */
.tests-section {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--bg-light);
}

.section-header h2 {
    font-size: 24px;
    color: var(--text-dark);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 126, 189, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--success) 100%);
    color: var(--white);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(126, 184, 189, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #6ea88a 100%);
    color: var(--white);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #a86e6e 100%);
    color: var(--white);
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

/* Tests List */
.tests-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.test-card {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: move;
}

.test-card:hover {
    background: var(--pastel-purple);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.test-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.test-card .drag-handle {
    color: var(--text-light);
    font-size: 20px;
    cursor: grab;
    padding: 0 5px;
}

.test-card .drag-handle:active {
    cursor: grabbing;
}

.test-info {
    flex: 1;
}

.test-info h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.test-info p {
    color: var(--text-light);
    font-size: 14px;
}

.test-info i {
    margin-right: 6px;
}

.test-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Questions List */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.question-item {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 20px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: move;
}

.question-item:hover {
    background: var(--pastel-blue);
    border-color: var(--secondary);
}

.question-item.dragging {
    opacity: 0.5;
    background: var(--pastel-yellow);
}

.question-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.drag-handle {
    font-size: 20px;
    color: var(--text-light);
    cursor: grab;
    padding: 5px;
}

.drag-handle:active {
    cursor: grabbing;
}

.question-number {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--white);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.question-content {
    flex: 1;
}

.question-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.5;
}

.answers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.answer-item {
    padding: 10px 15px;
    background: var(--white);
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.answer-item.correct {
    background: var(--pastel-green);
    border-left: 4px solid var(--success);
    font-weight: 600;
}

.answer-label {
    background: var(--primary);
    color: var(--white);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.answer-item.correct .answer-label {
    background: var(--success);
}

.question-actions {
    display: flex;
    gap: 10px;
}

/* Forms */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(155, 126, 189, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Radio Buttons */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.radio-item:hover {
    background: var(--pastel-purple);
}

.radio-item input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-item input[type="radio"]:checked + label {
    font-weight: 600;
}

.radio-item.selected {
    background: var(--pastel-green);
    border-color: var(--success);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-light);
}

.modal-header h2 {
    font-size: 24px;
    color: var(--text-dark);
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--danger);
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert i {
    font-size: 20px;
}

.alert-success {
    background: var(--pastel-green);
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-error {
    background: var(--pastel-pink);
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

.alert-info {
    background: var(--pastel-blue);
    color: var(--secondary);
    border-left: 4px solid var(--secondary);
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Login Page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .test-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* Smooth Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Toggle Pill Switch - Like the images */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 56px;
    height: 32px;
    background: #2c3e50; /* Dark gray/blue when OFF */
    border-radius: 32px;
    transition: background-color 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* When checked - GREEN like image 2 */
.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background: #27ae60; /* Green when ON */
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    min-width: 60px;
}

/* Hover effect */
.toggle-switch:hover .toggle-slider {
    opacity: 0.9;
}



