/* ==========================================
   RESET & BASE
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* ==========================================
   HEADER
   ========================================== */
header {
    background-color: #ffffff;
    border-bottom: 2px solid #e0e6ed;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #2c5aa0;
}

#main-nav {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-link {
    color: #555;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 14px;
}

.nav-link:hover,
.nav-link:focus {
    background-color: #e8f0fe;
    color: #2c5aa0;
    outline: 2px solid #2c5aa0;
    outline-offset: 2px;
}

.nav-link.active {
    background-color: #2c5aa0;
    color: #ffffff;
}

.profile-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #2c5aa0;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */
#app-main {
    flex: 1;
    padding: 30px 20px;
}

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

h2 {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
    margin-top: 25px;
}

h3 {
    font-size: 18px;
    color: #444;
    margin-bottom: 10px;
}

/* ==========================================
   CARDS
   ========================================== */
.card {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    border: 1px solid #e0e6ed;
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c5aa0;
}

.card-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.card-content {
    color: #555;
}

.card-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e6ed;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

.btn:focus {
    outline: 2px solid #2c5aa0;
    outline-offset: 2px;
}

.btn-primary {
    background-color: #2c5aa0;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #234a85;
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #e8f0fe;
    color: #2c5aa0;
    border: 1px solid #c5d9f1;
}

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

.btn-success {
    background-color: #28a745;
    color: #ffffff;
}

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

.btn-danger {
    background-color: #dc3545;
    color: #ffffff;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* ==========================================
   FORMS
   ========================================== */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: 2px solid #2c5aa0;
    border-color: #2c5aa0;
}

/* ==========================================
   BADGES & LABELS
   ========================================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* ==========================================
   LISTS
   ========================================== */
.skill-list {
    list-style: none;
}

.skill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    background-color: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e0e6ed;
    gap: 15px;
    flex-wrap: wrap;
}

.skill-label {
    flex: 1;
    font-weight: 500;
    min-width: 150px;
}

.skill-risk {
    font-size: 13px;
    color: #666;
}

.assessment-list {
    list-style: none;
}

.assessment-item {
    padding: 15px;
    margin-bottom: 12px;
    background-color: #ffffff;
    border-radius: 6px;
    border: 1px solid #e0e6ed;
}

.assessment-item h3 {
    margin-bottom: 8px;
}

.assessment-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #666;
    margin-top: 8px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    background-color: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e0e6ed;
    gap: 15px;
    flex-wrap: wrap;
}

.result-title {
    flex: 1;
    font-weight: 500;
    min-width: 200px;
}

.result-date {
    font-size: 13px;
    color: #666;
}

.result-score {
    font-weight: 600;
    font-size: 16px;
}

/* ==========================================
   GRID LAYOUTS
   ========================================== */
.grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-2 {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

/* ==========================================
   PROGRESS
   ========================================== */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e6ed;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background-color: #28a745;
    transition: width 0.3s;
}

/* ==========================================
   STATS
   ========================================== */
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e6ed;
}

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

.stat-label {
    font-weight: 500;
    color: #555;
}

.stat-value {
    font-weight: 600;
    color: #2c5aa0;
}

/* ==========================================
   EXERCISE
   ========================================== */
.exercise-container {
    background-color: #ffffff;
    border: 2px solid #2c5aa0;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
}

.exercise-question {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
    color: #333;
}

.exercise-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.exercise-input-group input {
    flex: 1;
    min-width: 150px;
}

.exercise-input-group select {
    flex: 0 0 120px;
}

.feedback {
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
}

.feedback-correct {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.feedback-incorrect {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.feedback-title {
    font-weight: 600;
    margin-bottom: 5px;
}

/* ==========================================
   TIMER
   ========================================== */
.timer {
    position: fixed;
    top: 80px;
    right: 20px;
    background-color: #2c5aa0;
    color: #ffffff;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 24px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 99;
}

/* ==========================================
   HISTORY
   ========================================== */
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.history-table th,
.history-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #e0e6ed;
}

.history-table th {
    background-color: #f5f7fa;
    font-weight: 600;
    color: #333;
}

.history-table tr:hover {
    background-color: #f9fafb;
}

/* ==========================================
   FOOTER
   ========================================== */
footer {
    background-color: #ffffff;
    border-top: 1px solid #e0e6ed;
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    #main-nav {
        width: 100%;
        justify-content: center;
    }
    
    .nav-link {
        flex: 1;
        text-align: center;
        font-size: 12px;
        padding: 8px 6px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .grid,
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .timer {
        top: auto;
        bottom: 20px;
        right: 20px;
        font-size: 20px;
        padding: 12px 20px;
    }
    
    .exercise-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .exercise-input-group select {
        flex: 1;
    }
}

/* ==========================================
   UTILITY
   ========================================== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}
