/*
    style.css
    Centralized design tokens, layout primitives and component styles used by
    the SkillGap frontend. Keep variables in `:root` so they can be overridden
    for alternate themes or design updates.
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Colors - Light Theme */
    --primary: #4F46E5;
    /* Indigo */
    --primary-hover: #4338CA;
    --primary-light: #E0E7FF;
    --accent: #06B6D4;
    /* Cyan */
    --accent-glow: rgba(6, 182, 212, 0.4);

    --bg-main: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-input: #F1F5F9;

    --text-primary: #0F172A;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;

    --border-color: #E2E8F0;

    /* UI Elements */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px var(--accent-glow);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --primary: #6366F1;
    --primary-hover: #818CF8;
    --primary-light: rgba(99, 102, 241, 0.2);
    --accent: #22D3EE;

    --bg-main: #0F172A;
    --bg-card: #1E293B;
    --bg-input: #0F172C;

    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --border-color: #334155;

    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
}

/* Forms & Buttons shared */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-control {
    padding-right: 3.5rem;
}

.password-toggle-btn {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.08);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background-color: var(--bg-card);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

/* Auth Layouts */
.auth-container {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-main) 0%, var(--primary-light) 100%);
    padding: 2rem;
}

.auth-card {
    display: flex;
    max-width: 1000px;
    width: 100%;
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-illustration {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-illustration::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 10%, transparent 10%),
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 10%, transparent 10%);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    opacity: 0.5;
    animation: drift 60s linear infinite;
}

@keyframes drift {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-50px, -50px);
    }
}

/* Animation for readiness score pulse effect when skill is completed */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animation for success notification slide in */
@keyframes slideIn {
    0% {
        transform: translateX(400px);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Animation for success notification slide out */
@keyframes slideOut {
    0% {
        transform: translateX(0);
        opacity: 1;
    }

    100% {
        transform: translateX(400px);
        opacity: 0;
    }
}

.auth-illustration h2,
.auth-illustration p {
    position: relative;
    z-index: 1;
}

.auth-form-container {
    flex: 1;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--bg-card);
}

.auth-header {
    margin-bottom: 2.5rem;
}

.auth-header h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Dashboard Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transition: var(--transition);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.nav-link i {
    font-size: 1.25rem;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-input);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    width: 300px;
}

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    color: var(--text-primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.content-wrapper {
    padding: 2.5rem;
    flex: 1;
    overflow-y: auto;
}

/* Dashboard Grid Component */
.dashboard-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.welcome-msg h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.career-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(6, 182, 212, 0.1) 100%);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.grid-2,
.grid-3,
.grid-4 {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.dashboard-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.75rem;
    transition: var(--transition);
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-full);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem;
    border-radius: 9999px;
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid transparent;
    transition: var(--transition);
}

.btn-icon:hover {
    background-color: var(--bg-input);
}

.circular-progress-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 0;
}

.circular-progress {
    position: relative;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: radial-gradient(circle at center, var(--bg-card) 50%, rgba(79, 70, 229, 0.08) 60%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 10px rgba(79, 70, 229, 0.08);
}

.progress-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.roadmap-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.course-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: var(--transition);
    cursor: pointer;
}

.course-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.course-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background-color: var(--primary-light);
    color: var(--primary);
    font-size: 1.2rem;
}

.difficulty-badge {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
}

.diff-advanced {
    background-color: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.diff-intermediate {
    background-color: rgba(34, 197, 94, 0.12);
    color: #166534;
}

.start-course-btn {
    width: 100%;
    justify-self: stretch;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

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

.admin-table th,
.admin-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.admin-table th {
    font-weight: 700;
    color: var(--text-secondary);
}

.skill-input-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
}

.skill-input-container input {
    flex: 1;
    min-width: 220px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text-primary);
}

.auth-card,
.dashboard-card,
.course-card {
    min-width: 0;
}

.auth-form-container {
    padding: 3rem;
}

.auth-illustration {
    min-height: 320px;
}

.auth-illustration h2 {
    font-size: 2rem;
}

.auth-illustration p {
    font-size: 1rem;
    max-width: 24rem;
}

@media (max-width: 1100px) {
    .header-search {
        width: 100%;
        max-width: 100%;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .content-wrapper {
        padding: 1.75rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .top-header {
        padding: 1rem;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 1rem;
    }

    .user-profile {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 820px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
    }

    .sidebar-logo {
        margin-bottom: 1rem;
    }

    .sidebar-nav {
        display: grid;
        gap: 0.5rem;
    }

    .nav-link {
        padding: 0.85rem 0.9rem;
        gap: 0.75rem;
    }

    .top-header {
        padding: 1rem;
        align-items: stretch;
    }

    .header-search {
        width: 100%;
    }

    .user-profile {
        width: 100%;
        justify-content: space-between;
    }

    .auth-card {
        flex-direction: column;
    }

    .auth-illustration,
    .auth-form-container {
        padding: 2rem;
    }

    .auth-illustration {
        min-height: auto;
    }
}

@media (max-width: 600px) {
    .sidebar {
        padding: 0.75rem;
    }

    .nav-link {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    .header-search {
        padding: 0.7rem 0.9rem;
    }

    .top-header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-search input {
        font-size: 0.95rem;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .career-badge {
        width: 100%;
        justify-content: center;
    }

    .auth-form-container {
        padding: 1.5rem;
    }

    .form-control,
    .btn,
    .skill-input-container {
        width: 100%;
    }
}