/* ==========================================
   BASE STYLES - Mobile First Approach
   ========================================== */

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

html, body {
    height: 100%;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    font-size: 16px;
}

/* ==========================================
   TYPOGRAPHY
   ========================================== */

h1 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #2c3e50;
}

h2 {
    font-size: 22px;
    margin-bottom: 16px;
    color: #34495e;
}

h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #34495e;
}

p {
    margin-bottom: 12px;
}

/* ==========================================
   LAYOUT & CONTAINERS
   ========================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

main {
    min-height: calc(100vh - 120px);
}

/* ==========================================
   FORMS & INPUTS
   ========================================== */

form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ==========================================
   BUTTONS
   ========================================== */

button,
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

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

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

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

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

/* ==========================================
   NAVIGATION
   ========================================== */

header {
    background-color: #2c3e50;
    color: white;
    padding: 12px 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.navbar-center {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
}

.company-link {
    color: white;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s;
    white-space: nowrap;
}

.company-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #3498db;
}

.btn-dashboard {
    background-color: #3498db;
    color: white;
    padding: 12px 32px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.btn-dashboard:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.user-name {
    font-size: 13px;
    color: white;
    white-space: nowrap;
}

.logout-form {
    display: inline;
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
    border-radius: 0;
}

.btn-logout {
    background-color: #e74c3c;
    color: white;
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-logout:hover {
    background-color: #c0392b;
    transform: scale(1.05);
}

/* Video Widget */
.video-widget {
    width: 50px;
    height: 50px;
    border: 2px solid white;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    background-color: #000;
}

.video-widget:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.video-widget video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-company-link {
    display: block;
    text-align: center;
    color: #2c3e50;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s;
}

.modal-company-link:hover {
    background-color: #ecf0f1;
    color: #3498db;
}

.video-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #000;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
}

.video-modal-close:hover {
    color: #e74c3c;
}

.video-modal-content video {
    width: 100%;
    border-radius: 4px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #3498db;
}

/* ==========================================
   LANGUAGE SWITCHER
   ========================================== */

.language-switcher {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.language-switcher button {
    padding: 8px 12px;
    font-size: 12px;
    border: 1px solid #bdc3c7;
    background-color: white;
    color: #2c3e50;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.language-switcher button.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.language-switcher button:hover {
    border-color: #3498db;
}

/* ==========================================
   ALERTS & NOTIFICATIONS
   ========================================== */

.alert {
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid;
    border-radius: 4px;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

/* ==========================================
   CARDS & PANELS
   ========================================== */

.card {
    background: white;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    background-color: #f8f9fa;
    padding: 16px;
    border-bottom: 1px solid #ecf0f1;
}

.card-body {
    padding: 16px;
}

.card-footer {
    background-color: #f8f9fa;
    padding: 12px 16px;
    border-top: 1px solid #ecf0f1;
}

/* ==========================================
   TABLES
   ========================================== */

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th {
    background-color: #34495e;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

tr:hover {
    background-color: #f8f9fa;
}

/* ==========================================
   EXAM SPECIFIC
   ========================================== */

.timer {
    font-size: 24px;
    font-weight: bold;
    color: #e74c3c;
    text-align: center;
    padding: 20px;
}

.timer.warning {
    color: #f39c12;
    animation: blink 1s infinite;
}

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

.question {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.question-number {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
}

.question-text {
    font-size: 16px;
    margin-bottom: 16px;
    line-height: 1.6;
}

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

.answer-option {
    display: flex;
    align-items: center;
}

.answer-option input[type="radio"],
.answer-option input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.answer-option label {
    margin: 0;
    cursor: pointer;
    font-weight: normal;
}

/* ==========================================
   FOOTER
   ========================================== */

footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

.footer-company-link {
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.footer-company-link:hover {
    color: #3498db;
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

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

.text-right {
    text-align: right;
}

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

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.hidden {
    display: none !important;
}

.text-muted {
    color: #7f8c8d;
}

.text-danger {
    color: #e74c3c;
}

.text-success {
    color: #27ae60;
}

.text-warning {
    color: #f39c12;
}

/* ==========================================
   LOADING SPINNER
   ========================================== */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #ecf0f1;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading {
    text-align: center;
    padding: 40px;
}

.loading .spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
    margin-bottom: 16px;
}
