/* Color Palette & Variables */
:root {
    --bg-color: #0f172a;
    /* Slate 900 */
    --surface-color: #1e293b;
    /* Slate 800 */
    --surface-hover: #334155;
    /* Slate 700 */
    --primary-color: #6366f1;
    /* Indigo 500 */
    --primary-hover: #4f46e5;
    /* Indigo 600 */
    --secondary-color: #ec4899;
    /* Pink 500 */
    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #cbd5e1;
    /* Slate 300 */
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --neon-shadow: 0 0 15px rgba(99, 102, 241, 0.5);

    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

h1,
h2,
h3,
h4 {
    font-weight: 600;
}

.text-blue {
    color: #3b82f6;
}

.text-pink {
    color: var(--secondary-color);
}

.text-emerald {
    color: #10b981;
}

/* App Layout */
#app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px 32px;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.logo i {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.8));
    background: -webkit-linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 12px;
    transition: all var(--transition-speed);
    font-weight: 500;
    font-size: 1.1rem;
}

.nav-links li a i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.nav-links li a:hover {
    background-color: var(--surface-hover);
    color: var(--text-main);
    transform: translateX(5px);
}

.nav-links li a.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--neon-shadow);
    transform: translateX(5px);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 0 40px 40px;
}

.topbar {
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    position: sticky;
    top: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    z-index: 50;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.topbar h1 {
    font-size: 1.8rem;
    background: -webkit-linear-gradient(45deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-profile img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    cursor: pointer;
}

/* Views Container */
.views-container {
    margin-top: 30px;
    position: relative;
    min-height: calc(100vh - 120px);
}

.view {
    display: none;
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards & Containers */
.card {
    background: var(--surface-color);
    border-radius: 20px;
    padding: 32px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.mt-4 {
    margin-top: 24px;
}

.text-center {
    text-align: center;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border-radius: 14px;
    border: none;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.6);
}

.btn-secondary {
    background: var(--surface-hover);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Hero Section */
.hero-card {
    background: linear-gradient(to right, var(--surface-color), rgba(30, 41, 59, 0.2));
    border-radius: 24px;
    padding: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 60%);
    opacity: 0.15;
    filter: blur(60px);
}

.hero-content {
    flex: 1;
    max-width: 600px;
    z-index: 1;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    line-height: 1.2;
    background: -webkit-linear-gradient(45deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-bottom: 35px;
    line-height: 1.7;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    z-index: 1;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    padding: 30px 24px;
    text-align: center;
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
}

.feature-card:hover {
    transform: translateY(-10px);
    background: var(--surface-color);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: inline-block;
}

.feature-icon.text-blue {
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
}

.feature-icon.text-pink {
    filter: drop-shadow(0 0 10px rgba(236, 72, 153, 0.5));
}

.feature-icon.text-emerald {
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.5));
}

.feature-card h3 {
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Animated Matrix Illustration */
.matrix-illustration {
    display: flex;
    align-items: center;
    font-size: 3.5rem;
    color: var(--primary-color);
    font-weight: 300;
    animation: float 4s ease-in-out infinite;
}

.matrix-illustration .bracket {
    font-size: 10rem;
    font-weight: 100;
    line-height: 1;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
    background: -webkit-linear-gradient(to bottom, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.matrix-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 0 25px;
    text-align: center;
}

.matrix-grid span {
    background: rgba(255, 255, 255, 0.05);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #fff;
}

.matrix-grid span:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: transparent;
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    background: rgba(30, 41, 59, 0.8);
    padding: 10px;
    border-radius: 16px;
    width: max-content;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.tab-content {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.hidden {
    display: none;
}

.tab-content h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: #fff;
}

.tab-content p {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 1.1rem;
}

/* Content Styling */
.formula-box {
    background: rgba(0, 0, 0, 0.4);
    padding: 24px;
    border-radius: 16px;
    margin: 20px 0;
    border: 1px solid rgba(99, 102, 241, 0.2);
    display: flex;
    justify-content: center;
    overflow-x: auto;
    font-size: 1.2rem;
}

.styled-list {
    list-style: none;
    margin-top: 16px;
}

.styled-list li {
    margin-bottom: 16px;
    padding-left: 28px;
    position: relative;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

.styled-list li::before {
    content: '\f0da';
    /* FontAwesome play icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--secondary-color);
}

.styled-list li strong {
    color: var(--text-main);
}

/* Interactive Calculator */
.interactive-workspace {
    text-align: center;
}

.interactive-workspace h3 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.interactive-workspace .subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 40px;
}

.matrix-calculator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.2);
    padding: 50px 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.matrix-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.matrix-label {
    font-weight: 600;
    font-size: 1.2rem;
    background: -webkit-linear-gradient(45deg, #a5b4fc, #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.neon-text {
    background: -webkit-linear-gradient(45deg, #10b981, #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.4rem;
}

.matrix-wrapper {
    display: flex;
    align-items: center;
}

.matrix-wrapper .bracket {
    font-size: 8rem;
    font-weight: 100;
    color: var(--text-main);
    line-height: 1;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.neon-bracket {
    color: #10b981 !important;
    /* Emerald 500 */
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.6) !important;
}

.matrix-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 0 15px;
}

.matrix-input-grid input {
    width: 80px;
    height: 80px;
    background: rgba(30, 41, 59, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: white;
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: all 0.3s;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Remove number arrows */
.matrix-input-grid input[type=number]::-webkit-inner-spin-button,
.matrix-input-grid input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.matrix-input-grid input[type=number] {
    -moz-appearance: textfield;
}

.matrix-input-grid input:focus {
    border-color: var(--primary-color);
    box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.2), 0 0 15px rgba(99, 102, 241, 0.4);
    transform: scale(1.05);
}

.matrix-input-grid input[readonly] {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.5);
    color: #10b981;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.operator-select select {
    appearance: none;
    background: linear-gradient(135deg, #3b82f6, #4f46e5);
    color: white;
    border: none;
    font-size: 2rem;
    font-weight: bold;
    padding: 10px 25px;
    border-radius: 16px;
    cursor: pointer;
    outline: none;
    text-align: center;
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
    transition: all 0.3s;
}

.operator-select select:hover {
    transform: scale(1.1);
}

.operator-equals {
    font-size: 4rem;
    font-weight: 300;
    color: var(--text-muted);
}

/* Quiz Section */
.quiz-container {
    max-width: 900px;
    margin: 0 auto;
}

.quiz-container.hidden {
    display: none;
}

.quiz-icon {
    font-size: 5rem;
    color: var(--secondary-color);
    margin-bottom: 30px;
    filter: drop-shadow(0 0 20px rgba(236, 72, 153, 0.6));
}

.quiz-icon.achievement {
    color: #f59e0b;
    filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.6));
}

.quiz-intro h3 {
    font-size: 2.2rem;
    margin-bottom: 16px;
}

.quiz-intro p {
    color: var(--text-muted);
    margin-bottom: 40px;
    font-size: 1.2rem;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

#question-tracker {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-muted);
}

.progress-bar {
    width: 300px;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 25%;
    transition: width 0.4s ease;
}

.question-content {
    font-size: 1.4rem;
    margin-bottom: 40px;
    line-height: 1.7;
    background: rgba(255, 255, 255, 0.03);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.option-btn {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    padding: 20px 30px;
    border-radius: 16px;
    color: var(--text-main);
    text-align: left;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
    transform: translateX(10px);
}

.option-btn.correct {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: #10b981 !important;
    color: #10b981 !important;
    transform: scale(1.02);
}

.option-btn.wrong {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}

.score-display {
    font-size: 6rem;
    font-weight: 700;
    background: -webkit-linear-gradient(45deg, #10b981, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 20px 0;
    filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.3));
}

/* Responsive */
@media (max-width: 1200px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .matrix-calculator {
        flex-direction: column;
        gap: 20px;
    }

    .operator-select select,
    .operator-equals {
        transform: rotate(90deg);
        margin: 10px 0;
    }

    .operator-select select:hover {
        transform: rotate(90deg) scale(1.1);
    }

    .hero-card {
        flex-direction: column;
        text-align: center;
        gap: 40px;
        padding: 40px 20px;
    }

    .hero-content {
        margin: 0 auto;
    }

    .hero-card::before {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 80px;
        align-items: center;
    }

    .logo span,
    .nav-links li a span {
        display: none;
    }

    .logo {
        padding: 0 0 20px 0;
        font-size: 1.5rem;
    }

    .nav-links li a {
        justify-content: center;
        padding: 16px;
    }

    .main-content {
        margin-left: 80px;
        padding: 0 20px 20px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .matrix-input-grid input {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .matrix-wrapper .bracket {
        font-size: 6rem;
    }

    .tabs {
        width: 100%;
        flex-direction: column;
    }
}

/* Ultra Mobile & Bottom Nav */
@media (max-width: 576px) {
    .sidebar {
        width: 100%;
        height: 70px;
        flex-direction: row;
        bottom: 0;
        top: auto;
        padding: 0;
        border-right: none;
        border-top: 1px solid var(--border-color);
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
    }

    .logo {
        display: none !important;
    }

    .nav-links {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        padding: 0;
        margin: 0;
    }

    .nav-links li {
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .nav-links li a {
        padding: 5px 2px;
        flex-direction: column;
        gap: 3px;
        text-align: center;
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    .nav-links li a span {
        display: block !important;
        font-size: 0.65rem;
        line-height: 1.1;
        white-space: pre-wrap;
    }

    .nav-links li a i {
        font-size: 1.2rem;
    }

    .nav-links li a:hover,
    .nav-links li a.active {
        transform: none;
    }

    .main-content {
        margin-left: 0;
        padding: 0 15px 90px;
    }

    .topbar {
        padding: 15px 0;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-card {
        padding: 30px 15px;
    }

    .matrix-input-grid input {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        border-radius: 10px;
    }

    .matrix-wrapper .bracket {
        font-size: 5rem;
    }

    .formula-box {
        font-size: 0.9rem;
        padding: 15px;
    }

    #sim-determinan .matrix-calculator {
        align-items: center;
        width: 100%;
    }

    .interactive-workspace h3 {
        font-size: 1.5rem;
    }

    .quiz-icon {
        font-size: 3rem;
    }

    .score-display {
        font-size: 4rem;
    }

    .option-btn {
        padding: 15px 20px;
        font-size: 1rem;
    }

    .tab-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .matrix-calculator {
        gap: 15px !important;
        padding: 20px 10px !important;
    }

    #skalar-k {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.2rem !important;
    }

    .explanation-content {
        padding: 0 !important;
    }

    .explanation-content>div {
        padding: 10px !important;
        gap: 10px !important;
        flex-direction: column !important;
    }

    .explanation-content .matrix-wrapper .bracket {
        font-size: 3.5rem !important;
    }

    .explanation-content .matrix-wrapper .bracket.expl-bracket-lg {
        font-size: 4.5rem !important;
    }

    .explanation-content .matrix-wrapper div>div {
        font-size: 0.85rem !important;
        padding: 5px !important;
    }

    .operator-equals {
        font-size: 2rem !important;
        margin: 5px 0 !important;
        transform: rotate(90deg);
        /* Vertical flow */
    }

    #sim-determinan .matrix-calculator {
        flex-direction: column !important;
    }

    #inv-result .matrix-wrapper .bracket {
        font-size: 3.5rem !important;
    }

    #inv-result .matrix-wrapper div>div {
        min-width: 50px !important;
        font-size: 0.9rem !important;
    }

    #inv-result>div {
        margin-right: 5px !important;
    }

    .card {
        padding: 20px 15px !important;
    }

    .matrix-input-grid {
        gap: 10px !important;
        padding: 0 5px !important;
    }
}

/* Fix SweetAlert z-index */
.swal2-container {
    z-index: 999999 !important;
}