/* Main CSS - Global Styles */
:root {
    /* Light Theme Variables */
    --primary-color: #1a73e8;
    --primary-light: #e8f0fe;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffcc00;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --light-card-bg: #ffffff;
    --border-color: #dee2e6;
    --text-color: #212529;
    --text-secondary: #6c757d;
    --marked-color: #800080;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --overlay-bg: rgba(255, 255, 255, 0.95);
    
    /* Animation Variables */
    --transition-fast: 0.15s;
    --transition-normal: 0.3s;
    --transition-slow: 0.5s;
    
    /* Spacing Variables */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border Radius */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    
    /* Font Sizes */
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 24px;
    --font-size-xxl: 32px;
}

/* Dark Theme Variables */
.dark-mode {
    --primary-color: #8ab4f8;
    --primary-light: #1f1f1f;
    --secondary-color: #9aa0a6;
    --light-bg: #121212;
    --light-card-bg: #1e1e1e;
    --border-color: #333333;
    --text-color: #e8eaed;
    --text-secondary: #9aa0a6;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --overlay-bg: rgba(18, 18, 18, 0.95);
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
}

.screen.active {
    display: block;
}

.material-symbols-rounded {
    vertical-align: middle;
    font-size: 20px;
    margin-right: 4px;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-weight: 500;
}

.primary-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.secondary-btn {
    background-color: var(--light-card-bg);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-weight: 500;
}

.secondary-btn:hover:not(:disabled) {
    background-color: var(--primary-light);
}

input, select {
    font-family: inherit;
    font-size: var(--font-size-md);
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background-color: var(--light-card-bg);
    color: var(--text-color);
    width: 100%;
    transition: border-color var(--transition-fast);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 12px;
    transition: all var(--transition-normal);
}

/* Position differently in exam screen */
#exam-screen .theme-toggle {
    top: auto;
    bottom: 20px;
    right: 20px;
}

.theme-toggle button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0.85;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy animation */
}

.theme-toggle button:hover {
    transform: translateY(-4px) scale(1.05);
    opacity: 1;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.theme-toggle button:active {
    transform: scale(0.95);
}

.theme-toggle button .material-symbols-rounded {
    margin-right: 0;
    font-size: 24px;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--light-card-bg);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 24px var(--shadow-color);
}

.modal-content h2 {
    margin-bottom: 16px;
    color: var(--text-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Ripple effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 1s;
}

.ripple:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .theme-toggle {
        top: 8px;
        right: 8px;
    }
    
    .theme-toggle button {
        width: 36px;
        height: 36px;
    }
}
