:root {
    --bg-color: #0b101e;
    --acc-color: #3b82f6;
    --acc-hover: #60a5fa;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --python-yellow: #FFCF40;
    --python-blue: #3776AB;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at top right, #111a31 0%, #0b101e 100%);
}

.shape {
    position: absolute;
    filter: blur(100px);
    opacity: 0.5;
    animation: drift 20s infinite alternate ease-in-out;
}

.shape-1 {
    width: 40px;
    height: 40px;
    background-color: rgba(59, 130, 246, 0.15);
    top: -10%;
    left: -10%;
    transform: scale(10);
}

.shape-2 {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 207, 64, 0.1);
    top: 40%;
    right: -10%;
    animation-delay: -5s;
    transform: scale(10);
}

.shape-3 {
    width: 30px;
    height: 30px;
    background-color: rgba(139, 92, 246, 0.15);
    bottom: -10%;
    left: 20%;
    animation-delay: -10s;
    transform: scale(10);
}

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

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

h1,
h2,
h3 {
    font-weight: 800;
}

a {
    text-decoration: none;
    color: inherit;
}

.highlight {
    background: linear-gradient(120deg, var(--python-yellow), var(--acc-hover));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(11, 16, 30, 0.8);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
}

.logo i {
    color: var(--python-yellow);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 0%;
    height: 2px;
    background: var(--acc-color);
    transition: width 0.3s ease;
}

.nav-links a.active::after,
.nav-links a:hover::after {
    width: 100%;
}

.semester-selector select {
    background: var(--glass-bg);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
}

.semester-selector select option {
    background: var(--bg-color);
    color: var(--text-main);
}

/* Auth and User Profile */
.auth-box {
    display: flex;
    align-items: center;
}

.google-btn {
    background-color: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 20px;
    padding: 0.4rem 1.5rem 0.4rem 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    min-width: 140px;
}

.google-btn:hover {
    background-color: #f8f9fa;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.g-icon-wrapper {
    background: #fff;
    border-radius: 50%;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.g-icon-wrapper img {
    width: 20px;
    height: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--glass-bg);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    border: 1px solid var(--acc-color);
}

.user-profile.hidden {
    display: none;
}

#user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

#user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-small {
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
}

/* Main Layout */
.section {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section.alternate {
    background: rgba(0, 0, 0, 0.2);
    max-width: 100%;
}

.section.alternate>div {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 50%;
    transform: translateX(50%);
    width: 60px;
    height: 4px;
    background: var(--acc-color);
    border-radius: 2px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8rem;
    gap: 4rem;
}

.hero-content {
    flex: 1;
    transform: translateX(-100px);
}

.badge {
    display: inline-block;
    padding: 0.25rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    color: var(--acc-hover);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 99px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.hero h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero .subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--acc-color);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    background: var(--acc-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--acc-color);
}

/* Code Window */
.hero-graphic {
    flex: 1;
    perspective: 1000px;
}

.code-window {
    background: #1e1e1e;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    transform: rotateY(-5deg) rotateX(5deg);
    transition: transform 0.5s ease;
}

.code-window:hover {
    transform: rotateY(0) rotateX(0);
}

.window-header {
    background: #2d2d2d;
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background: #ff5f56;
}

.dot.yellow {
    background: #ffbd2e;
}

.dot.green {
    background: #27c93f;
}

pre {
    padding: 1.5rem;
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
}

.keyword {
    color: #c678dd;
}

.func {
    color: #61afef;
}

.string {
    color: #98c379;
}

.built-in {
    color: #e5c07b;
}

/* Grids & Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

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

.card {
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--acc-hover);
    font-size: 1.2rem;
}

.card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.hw-weight {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--acc-hover);
    margin-bottom: 1rem;
    font-weight: 600;
}

.hw-weight i {
    font-size: 0.75rem;
}

.feature-card {
    align-items: center;
    text-align: center;
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--acc-color);
    margin-bottom: 1.5rem;
}



/* Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 15px;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--glass-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-right: 3rem;
}

.timeline-dot {
    position: absolute;
    right: 9px;
    top: 20px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--acc-color);
    box-shadow: 0 0 10px var(--acc-color);
}

.timeline-content {
    padding: 1.5rem;
}

.timeline-content h3 {
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.link-btn {
    color: var(--acc-hover);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.link-btn:hover {
    color: white;
}

/* Exam Prep */
.exam-prep-container {
    max-width: 900px;
    margin: 0 auto;
}

.exam-prep-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.exam-prep-tab {
    padding: 0.7rem 1.5rem;
    border-radius: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Assistant', sans-serif;
}

.exam-prep-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.15);
}

.exam-prep-tab.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.15));
    border-color: var(--acc-color);
    color: var(--text-main);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.exam-prep-tab .tab-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
}

.exam-prep-tab.active .tab-number {
    background: var(--acc-color);
    color: white;
}

.algorithm-panel {
    display: none;
    animation: fadeSlideIn 0.4s ease;
}

.algorithm-panel.active {
    display: block;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

.algorithm-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
}

.algorithm-card-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.algo-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.algo-icon.count {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.algo-icon.max {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.algo-icon.bool {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.algo-icon.closest {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.algorithm-card-header h3 {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.algorithm-card-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.algo-code-window {
    background: #1e1e1e;
    margin: 0;
    border-top: none;
}

.algo-code-window .window-header {
    background: #2d2d2d;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.algo-code-window .window-header .file-name {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-right: auto;
    font-family: 'Fira Code', 'Courier New', monospace;
}

.algo-code-window pre {
    padding: 1.25rem 1.5rem;
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.65;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
}

.algo-code-window .comment {
    color: #6a9955;
}

.algo-code-window .keyword {
    color: #c678dd;
}

.algo-code-window .func {
    color: #61afef;
}

.algo-code-window .built-in {
    color: #e5c07b;
}

.algo-code-window .number {
    color: #d19a66;
}

.algo-code-window .string {
    color: #98c379;
}

.algo-code-window .operator {
    color: #56b6c2;
}

.algorithm-card-footer {
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.algo-tag {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
    color: var(--acc-hover);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.algo-tag.return-type {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.15);
}

/* Practice Mode (שינון) */
.practice-btn {
    margin-right: auto;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #a78bfa;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Assistant', sans-serif;
    flex-shrink: 0;
}

.practice-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.5);
    transform: scale(1.05);
}

.practice-btn.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.practice-mode {
    display: flex;
    flex-direction: row;
    background: #1e1e1e;
    min-height: 0;
    direction: ltr;
}

.practice-line-numbers {
    padding: 1.25rem 0;
    background: #1e1e1e;
    display: flex;
    flex-direction: column;
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
    flex-shrink: 0;
    min-width: calc(2em + 1em + 1em + 1px);
}

.practice-line-numbers span {
    display: block;
    width: 2em;
    padding-right: 1em;
    margin-right: 1em;
    text-align: right;
    color: rgba(255, 255, 255, 0.25);
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.88rem;
    line-height: 1.65;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-sizing: content-box;
}

.practice-textarea {
    flex: 1;
    min-height: 280px;
    padding: 1.25rem 1rem;
    background: #1e1e1e;
    border: none;
    color: #d4d4d4;
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.88rem;
    line-height: 1.65;
    resize: none;
    direction: ltr;
    text-align: left;
    box-sizing: border-box;
    outline: none;
    overflow-y: auto;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
    tab-size: 4;
}

.practice-textarea:focus {
    background: #1e1e1e;
}

.practice-textarea::placeholder {
    color: rgba(255, 255, 255, 0.15);
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    direction: ltr;
    text-align: left;
}

/* Line Numbers (VS Code style) */
pre code {
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

.code-line {
    display: flex;
    line-height: 1.5;
}

.line-number {
    display: inline-block;
    width: 2em;
    padding-right: 1em;
    margin-right: 1em;
    text-align: right;
    color: rgba(255, 255, 255, 0.25);
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
    font-size: inherit;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.line-content {
    flex: 1;
    white-space: pre;
}

/* Exams */
.exams-container {
    display: flex;
    gap: 3rem;
    padding: 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.exam-info {
    flex: 1;
}

.exam-info h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.exam-info p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.exam-info ul {
    list-style: none;
}

.exam-info li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.exam-info li i {
    color: #22c55e;
}

.exam-list {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.exam-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    transition: all 0.2s;
}

.exam-link:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(-5px);
    border-color: var(--acc-color);
}

/* Footer */
.glass-footer {
    background: rgba(11, 16, 30, 0.9);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    padding: 3rem 2rem;
    margin-top: 4rem;
    text-align: center;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.footer-logo i {
    color: var(--python-yellow);
}

.footer-content p {
    color: var(--text-muted);
}

/* Animations */
.fade-in {
    opacity: 0;
    transition: opacity 1s ease;
}

.fade-in.visible {
    opacity: 1;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Responsive */
@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 6rem;
        gap: 2rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .layout-3 {
        grid-template-columns: 1fr;
    }

    .exams-container {
        flex-direction: column;
    }

    .nav-links {
        display: none;
    }
}