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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #e8e8e8;
}

/* Anti-copy protection */
.no-copy,
.no-copy * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    -khtml-user-select: none;
}

.no-copy::selection,
.no-copy *::selection {
    background: transparent;
}

.no-copy::-moz-selection,
.no-copy *::-moz-selection {
    background: transparent;
}

/* Loading spinner */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #4a90d9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #4a90d9;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    font-size: 0.9rem;
    color: #a0a0a0;
}

.btn-logout {
    background: transparent;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #e74c3c;
    color: white;
}

/* Auth Forms */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8rem;
    color: #4a90d9;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #a0a0a0;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e8e8e8;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.2);
}

.form-group input::placeholder {
    color: #666;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 144, 217, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #a0a0a0;
    font-size: 0.9rem;
}

.auth-link a {
    color: #4a90d9;
    text-decoration: none;
    cursor: pointer;
}

.auth-link a:hover {
    text-decoration: underline;
}

.error-message {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid #e74c3c;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    color: #e74c3c;
    font-size: 0.9rem;
}

.success-message {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid #2ecc71;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    color: #2ecc71;
    font-size: 0.9rem;
}

/* Dashboard */
.dashboard {
    padding: 40px 20px;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 40px;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-card h2 {
    margin-bottom: 20px;
    color: #4a90d9;
}

.dashboard-card p {
    margin-bottom: 30px;
    color: #a0a0a0;
    line-height: 1.6;
}

.test-info {
    background: rgba(74, 144, 217, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.test-info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.test-info-item span:first-child {
    color: #a0a0a0;
}

.test-info-item span:last-child {
    color: #4a90d9;
    font-weight: 600;
}

.btn-start {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.test-completed {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 12px;
    padding: 30px;
}

.test-completed h3 {
    color: #2ecc71;
    margin-bottom: 15px;
}

/* Test Page */
.test-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.test-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.timer {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4a90d9;
    font-family: monospace;
}

.timer.warning {
    color: #f39c12;
}

.timer.danger {
    color: #e74c3c;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.progress-info {
    font-size: 0.9rem;
    color: #a0a0a0;
}

.progress-bar {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a90d9, #2ecc71);
    transition: width 0.3s;
}

.test-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.question-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.question-number {
    font-size: 0.9rem;
    color: #4a90d9;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.question-text {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #e8e8e8;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.option:hover {
    background: rgba(74, 144, 217, 0.1);
    border-color: rgba(74, 144, 217, 0.3);
}

.option.selected {
    background: rgba(74, 144, 217, 0.15);
    border-color: #4a90d9;
}

.option-letter {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-right: 15px;
    font-weight: 600;
    flex-shrink: 0;
}

.option.selected .option-letter {
    background: #4a90d9;
    color: white;
}

.option-text {
    flex: 1;
    line-height: 1.5;
}

.question-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-nav {
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e8e8e8;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-nav:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
}

.btn-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-finish {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border: none;
    color: white;
    font-weight: 600;
}

.btn-finish:hover {
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.4);
}

/* Result Page */
.result-container {
    padding: 40px 20px;
}

.result-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 50px;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.result-icon.passed {
    color: #2ecc71;
}

.result-icon.failed {
    color: #e74c3c;
}

.result-card h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.result-card h2.passed {
    color: #2ecc71;
}

.result-card h2.failed {
    color: #e74c3c;
}

.result-score {
    font-size: 4rem;
    font-weight: 700;
    margin: 30px 0;
    color: #4a90d9;
}

.result-details {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin: 30px 0;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-row:last-child {
    border-bottom: none;
}

/* Admin Panel */
.admin-container {
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.admin-tab {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #a0a0a0;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-tab:hover {
    background: rgba(255, 255, 255, 0.1);
}

.admin-tab.active {
    background: #4a90d9;
    border-color: #4a90d9;
    color: white;
}

.admin-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.admin-card-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-card-header h3 {
    color: #4a90d9;
}

.btn-add {
    padding: 10px 20px;
    background: #2ecc71;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add:hover {
    background: #27ae60;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table th {
    background: rgba(255, 255, 255, 0.03);
    color: #a0a0a0;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-passed {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.badge-failed {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.badge-in-progress {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}

.btn-icon {
    padding: 8px;
    background: transparent;
    border: none;
    color: #a0a0a0;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e8e8e8;
}

.btn-icon.delete:hover {
    color: #e74c3c;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: #1a1a2e;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #4a90d9;
}

.btn-close {
    background: transparent;
    border: none;
    color: #a0a0a0;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cancel {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e8e8e8;
    cursor: pointer;
}

.btn-save {
    padding: 12px 24px;
    background: #4a90d9;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
}

textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e8e8e8;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

textarea:focus {
    outline: none;
    border-color: #4a90d9;
}

select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e8e8e8;
    font-size: 1rem;
}

select:focus {
    outline: none;
    border-color: #4a90d9;
}

/* Filter */
.filter-bar {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-bar input,
.filter-bar select {
    padding: 10px 15px;
    max-width: 200px;
}

/* Main Header */
.main-header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: #4a90d9;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.main-nav a {
    color: #a0a0a0;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e8e8e8;
}

.main-nav a.active {
    background: rgba(74, 144, 217, 0.2);
    color: #4a90d9;
}

.main-content {
    min-height: calc(100vh - 60px);
}

/* Dashboard Updates */
.welcome-section {
    text-align: center;
    padding: 40px 20px 20px;
}

.welcome-section h2 {
    color: #e8e8e8;
    margin-bottom: 8px;
}

.user-group {
    color: #a0a0a0;
}

.card-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.dashboard-card h3 {
    color: #4a90d9;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.test-info p {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.test-info p:last-child {
    border-bottom: none;
}

.test-rules {
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.test-rules h4 {
    color: #a0a0a0;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.test-rules ul {
    list-style: none;
    padding: 0;
}

.test-rules li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    color: #a0a0a0;
    font-size: 0.9rem;
}

.test-rules li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #4a90d9;
}

.btn-large {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.result-summary {
    padding: 30px 0;
}

.result-score {
    font-size: 3rem;
    font-weight: 700;
}

.score-value {
    color: #4a90d9;
}

.score-separator {
    color: #666;
    margin: 0 5px;
}

.score-total {
    color: #666;
}

.result-status {
    margin-top: 15px;
    font-size: 1.1rem;
}

.result-status.passed {
    color: #2ecc71;
}

.result-status.failed {
    color: #e74c3c;
}

.attempt-info {
    color: #a0a0a0;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn-secondary {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e8e8e8;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Test Page Updates */
.test-container {
    display: flex;
    flex-direction: row;
    min-height: calc(100vh - 60px);
}

.test-sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.03);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    order: 1;
    flex-shrink: 0;
}

.test-main {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    order: 2;
}

.timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: rgba(74, 144, 217, 0.1);
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #4a90d9;
    font-family: monospace;
}

.timer.urgent {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    animation: pulse 1s infinite;
}

.timer-icon {
    font-size: 1.2rem;
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.grid-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #a0a0a0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.grid-btn:hover {
    background: rgba(74, 144, 217, 0.2);
    border-color: rgba(74, 144, 217, 0.3);
}

.grid-btn.current {
    background: #4a90d9;
    border-color: #4a90d9;
    color: white;
}

.grid-btn.answered {
    background: rgba(30, 60, 114, 0.8);
    border-color: #1e3c72;
    color: #fff;
}

.btn-finish {
    width: 100%;
    margin-top: auto;
    padding: 14px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-finish:hover {
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

.question-card {
    width: 100%;
    max-width: none;
}

.question-content {
    margin: 20px 0 30px;
}

.nav-info {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.nav-info .current {
    color: #4a90d9;
    font-weight: 600;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 320px;
}

.answer-option {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.answer-option:hover {
    background: rgba(74, 144, 217, 0.1);
    border-color: rgba(74, 144, 217, 0.3);
}

.answer-option.selected {
    background: rgba(74, 144, 217, 0.25);
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.3);
}

.answer-option .option-letter {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-right: 15px;
    font-weight: 600;
    flex-shrink: 0;
}

.answer-option.selected .option-letter {
    background: #4a90d9;
    color: white;
}

.answer-option .option-text {
    flex: 1;
    line-height: 1.5;
    padding-top: 4px;
}

/* Modal Updates */
.modal {
    padding: 30px;
}

.modal h3 {
    color: #4a90d9;
    margin-bottom: 20px;
}

.modal p {
    color: #a0a0a0;
    margin-bottom: 10px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.modal-large {
    max-width: 700px;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: none;
    color: white;
}

.text-muted {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

/* Results Page */
.results-container {
    padding: 40px 20px;
}

.results-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 40px;
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.results-card h2 {
    text-align: center;
    color: #4a90d9;
    margin-bottom: 30px;
}

.result-header {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.result-header.passed {
    background: rgba(46, 204, 113, 0.1);
}

.result-header.failed {
    background: rgba(231, 76, 60, 0.1);
}

.status-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.status-text {
    font-size: 1.5rem;
    font-weight: 600;
}

.result-header.passed .status-text {
    color: #2ecc71;
}

.result-header.failed .status-text {
    color: #e74c3c;
}

.result-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.score-circle-container {
    text-align: center;
}

.score-circle {
    width: 150px;
    height: 150px;
}

.score-text {
    font-size: 24px;
    font-weight: 700;
    fill: #e8e8e8;
}

.score-details {
    margin-top: 15px;
}

.score-details .score-value {
    display: block;
    font-size: 1.2rem;
    color: #4a90d9;
    font-weight: 600;
}

.score-details .score-label {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.result-info {
    width: 100%;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.info-label {
    color: #a0a0a0;
}

.info-value {
    font-weight: 600;
}

.info-value.passed {
    color: #2ecc71;
}

.info-value.failed {
    color: #e74c3c;
}

.result-message {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin: 20px 0;
}

.result-message p {
    color: #a0a0a0;
    line-height: 1.6;
}

.result-actions {
    text-align: center;
}

/* Attempts History */
.attempts-history {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.attempts-history h3 {
    color: #4a90d9;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.2rem;
}

.attempts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.attempt-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    transition: all 0.2s;
}

.attempt-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.attempt-item.passed {
    border-left: 3px solid #2ecc71;
}

.attempt-item.failed {
    border-left: 3px solid #e74c3c;
}

.attempt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.attempt-number {
    font-weight: 600;
    color: #e8e8e8;
}

.attempt-status {
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 12px;
}

.attempt-item.passed .attempt-status {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.attempt-item.failed .attempt-status {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.attempt-body {
    display: flex;
    align-items: center;
    gap: 20px;
}

.attempt-details {
    flex: 1;
}

.attempt-score,
.attempt-date {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}

.detail-label {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.detail-value {
    font-weight: 500;
}

.detail-value.passed {
    color: #2ecc71;
}

.detail-value.failed {
    color: #e74c3c;
}

/* Small score circle for attempts */
.score-circle-container.small {
    flex-shrink: 0;
}

.score-circle-container.small .score-circle {
    width: 60px;
    height: 60px;
}

.score-circle-container.small .score-text {
    font-size: 14px;
}

/* Admin Panel Updates */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-header h2 {
    color: #4a90d9;
}

.tab-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #a0a0a0;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    background: #4a90d9;
    border-color: #4a90d9;
    color: white;
}

.admin-tab-content {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.tab-header h3 {
    color: #e8e8e8;
}

.filter-container {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

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

.filter-container label,
.filter-item label {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.filter-container select,
.filter-item select {
    padding: 8px 12px;
    width: auto;
    min-width: 150px;
}

.date-input {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e8e8e8;
    font-size: 0.9rem;
}

.date-input:focus {
    outline: none;
    border-color: #4a90d9;
}

.btn-clear {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #a0a0a0;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-clear:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
    color: #e74c3c;
}

.admin-table-container {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table th {
    background: rgba(255, 255, 255, 0.03);
    color: #a0a0a0;
    font-weight: 500;
    font-size: 0.85rem;
}

.admin-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.status-passed {
    color: #2ecc71;
    font-weight: 600;
}

.status-failed {
    color: #e74c3c;
    font-weight: 600;
}

.no-data {
    text-align: center;
    color: #666;
    padding: 40px;
}

.questions-stats {
    color: #a0a0a0;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.questions-grid {
    display: grid;
    gap: 15px;
}

.question-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.question-id {
    color: #4a90d9;
    font-weight: 600;
    font-size: 0.85rem;
}

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

.question-actions .btn-icon {
    font-size: 1rem;
    padding: 6px;
}

.question-preview {
    color: #e8e8e8;
    line-height: 1.5;
    margin-bottom: 12px;
}

.question-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.option-tag {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 0.8rem;
    color: #a0a0a0;
}

.option-tag.correct {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

/* Responsive - larger screens keep horizontal layout */
@media (max-width: 1024px) {
    .test-sidebar {
        width: 220px;
    }

    .question-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .grid-btn {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .test-sidebar {
        width: 180px;
    }

    .question-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .grid-btn {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .test-main {
        padding: 15px;
    }

    .test-header {
        flex-direction: column;
        gap: 15px;
    }

    .question-nav {
        flex-direction: column;
        gap: 10px;
    }

    .nav-buttons {
        width: 100%;
    }

    .btn-nav {
        flex: 1;
    }

    .admin-tabs {
        flex-wrap: wrap;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar input,
    .filter-bar select {
        max-width: 100%;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 10px;
    }

    .modal {
        margin: 10px;
        padding: 20px;
    }

    .modal-large {
        max-width: 100%;
    }
}

/* Only stack vertically on very small screens */
@media (max-width: 500px) {
    .test-container {
        flex-direction: column;
    }

    .test-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .timer {
        width: 100%;
    }

    .question-grid {
        grid-template-columns: repeat(8, 1fr);
        flex: 1;
    }

    .btn-finish {
        margin-top: 10px;
    }
}
