/* CSS Variables */
:root {
    --primary-color: #1a1a1a;
    --secondary-color: #32cd32;
    --accent-color: #32cd32;
    --background-color: #fdf8f3;
    --surface-color: #f5f0e8;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --border-color: #d0d0d0;
    --font-family: 'JetBrains Mono', monospace;
    --font-size-base: 1rem;
    --border-radius: 0.75rem;
    --shadow-intensity: 0.5;
    --animation-speed: 0.3s;
}

html.theme-dark {
    --primary-color: #fdf8f3;
    --secondary-color: #32cd32;
    --accent-color: #32cd32;
    --background-color: #1a1a1a;
    --surface-color: #2a2a2a;
    --text-primary: #fdf8f3;
    --text-secondary: #d0d0d0;
    --border-color: #4a4a4a;
}

html.theme-dark .college-building { opacity: 0.8; filter: blur(0.2px); }
html.theme-dark .building-1 { background: #ffffff; opacity: 0.7; box-shadow: 0 0 40px rgba(255,255,255,0.2); }
html.theme-dark .building-2 { background: #32cd32; opacity: 0.6; box-shadow: 0 0 35px rgba(50,205,50,0.3); }
html.theme-dark .building-3 { background: #ffff00; opacity: 0.5; box-shadow: 0 0 30px rgba(255,255,0,0.25); }
html.theme-dark .hero-background { opacity: 0.5; }
html.theme-dark .college-building { animation: buildingGlowDark 4s ease-in-out infinite alternate; }

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
    transition: all var(--animation-speed) ease;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.header {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    position: relative;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links { display: flex; list-style: none; gap: 2rem; }
.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--animation-speed) ease;
}
.nav-links a:hover { color: var(--secondary-color); }

.cta-button {
    background: var(--primary-color);
    color: var(--background-color);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--animation-speed) ease;
    text-decoration: none;
    display: inline-block;
    margin-right: 60px;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
}
.cta-button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Hero */
.hero {
    padding: 4rem 0;
    text-align: center;
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--background-color) 100%);
    position: relative;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
    opacity: 0.3;
}

.college-building {
    position: absolute;
    bottom: 0;
    width: 300px;
    height: 400px;
    background: var(--primary-color);
    filter: blur(0.5px);
    animation: buildingGlow 4s ease-in-out infinite alternate;
    opacity: 0.4;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.building-1 {
    right: 10%;
    clip-path: polygon(0% 100%, 0% 60%, 20% 50%, 20% 30%, 40% 20%, 40% 0%, 60% 10%, 60% 30%, 80% 40%, 80% 60%, 100% 50%, 100% 100%);
}
.building-2 {
    right: 5%;
    width: 200px; height: 300px;
    background: var(--secondary-color);
    opacity: 0.3;
    animation-delay: 2s;
    clip-path: polygon(0% 100%, 0% 70%, 30% 60%, 30% 40%, 60% 30%, 60% 10%, 100% 20%, 100% 100%);
}
.building-3 {
    right: 15%;
    width: 150px; height: 250px;
    background: var(--accent-color);
    opacity: 0.2;
    animation-delay: 4s;
    clip-path: polygon(0% 100%, 0% 80%, 25% 70%, 25% 50%, 50% 40%, 50% 20%, 75% 30%, 75% 50%, 100% 40%, 100% 100%);
}

@keyframes buildingGlow {
    0%   { opacity: 0.4; transform: translateY(5px); }
    100% { opacity: 0.7; transform: translateY(0); }
}
@keyframes buildingGlowDark {
    0%   { opacity: 0.5; transform: translateY(5px); }
    100% { opacity: 0.8; transform: translateY(0); }
}

.hero .container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    text-align: center;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
    text-align: center;
}

.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn-primary {
    background: var(--primary-color);
    color: var(--background-color);
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--animation-speed) ease;
    text-decoration: none;
    display: inline-block;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
}
.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    padding: 1rem 2rem;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--animation-speed) ease;
    text-decoration: none;
    display: inline-block;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
}
.btn-secondary:hover { background: var(--primary-color); color: white; transform: translateY(-2px); }

/* Features */
.features { padding: 4rem 0; background: var(--background-color); }

.section-title {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-subtitle {
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: all var(--animation-speed) ease;
}
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.feature-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 1.4rem;
    color: white;
}

.feature-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--text-primary); }
.feature-card p { color: var(--text-secondary); line-height: 1.6; font-size: 0.9rem; }

/* Stats */
.stats { padding: 4rem 0; background: var(--surface-color); }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}
.stat-item { padding: 1.5rem; }
.stat-number { font-size: 3rem; font-weight: 800; color: var(--primary-color); margin-bottom: 0.5rem; }
.stat-label { font-size: 1rem; color: var(--text-secondary); font-weight: 500; }

/* CTA section */
.cta-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
}
.cta-section h2 { font-size: 2.25rem; font-weight: 700; margin-bottom: 1rem; }
.cta-section p {
    font-size: 1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.cta-section .cta-button {
    background: var(--background-color);
    color: var(--primary-color);
    font-size: 1rem;
    padding: 1rem 2rem;
    margin-right: 0;
}
.cta-section .cta-button:hover { background: var(--accent-color); color: white; }

/* Footer */
.footer {
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Auth Modal */
.auth-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.auth-modal-content {
    background-color: var(--surface-color);
    margin: 5% auto;
    padding: 0;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-50px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--border-color);
}
.auth-modal-header h2 { color: var(--text-primary); font-size: 1.4rem; font-weight: 700; margin: 0; }

.close-btn {
    background: none; border: none;
    font-size: 1.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: all var(--animation-speed) ease;
}
.close-btn:hover { background-color: var(--border-color); color: var(--text-primary); }

.auth-modal-body { padding: 2rem; }

.google-signin-container { text-align: center; margin-bottom: 1.5rem; }

.auth-divider { text-align: center; margin: 1.5rem 0; position: relative; }
.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 1px;
    background-color: var(--border-color);
}
.auth-divider span {
    background-color: var(--surface-color);
    padding: 0 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-info { text-align: center; }
.auth-info p { color: var(--text-secondary); margin-bottom: 1.25rem; line-height: 1.6; font-size: 0.9rem; }

.auth-benefits { list-style: none; padding: 0; margin: 0; text-align: left; max-width: 280px; margin: 0 auto; }
.auth-benefits li { color: var(--text-primary); margin-bottom: 0.5rem; font-size: 0.875rem; }

/* User Modal */
.user-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.user-modal-content {
    background-color: var(--surface-color);
    margin: 10% auto;
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 380px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.user-profile { text-align: center; }
.user-avatar { width: 80px; height: 80px; border-radius: 50%; margin-bottom: 1rem; border: 3px solid var(--primary-color); }
.user-info h3 { color: var(--text-primary); margin-bottom: 0.5rem; font-size: 1.2rem; }
.user-info p { color: var(--text-secondary); margin-bottom: 1.5rem; font-size: 0.875rem; }

.workspace-info {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: left;
}
.workspace-info h4 { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); margin-bottom: 0.5rem; }
.workspace-path {
    font-size: 0.8rem;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    word-break: break-all;
}

.logout-btn {
    background: var(--primary-color);
    color: var(--background-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--animation-speed) ease;
    font-family: var(--font-family);
}
.logout-btn:hover { background: var(--secondary-color); transform: translateY(-2px); }

.header.user-logged-in .cta-button { display: none; }

.user-profile-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--animation-speed) ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-family);
    margin-right: 60px;
}
.user-profile-btn:hover { background: var(--primary-color); color: var(--background-color); }
.user-avatar-small { width: 24px; height: 24px; border-radius: 50%; }

/* Folder tree visualization */
.folder-tree {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.8;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    margin-top: 0.75rem;
}
.folder-tree .dir { color: var(--primary-color); font-weight: 600; }
.folder-tree .file { color: var(--text-secondary); }
.folder-tree .tree-line::before { content: '│  '; color: var(--border-color); }
.folder-tree .tree-branch::before { content: '├── '; color: var(--border-color); }
.folder-tree .tree-last::before { content: '└── '; color: var(--border-color); }

/* Animations */
.fade-in { animation: fadeIn 0.8s ease-out; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.slide-in-left { animation: slideInLeft 0.8s ease-out; }
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}
.slide-in-right { animation: slideInRight 0.8s ease-out; }
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .nav { flex-direction: column; gap: 1rem; padding: 0.75rem 0; }
    .nav-links { gap: 1rem; flex-wrap: wrap; justify-content: center; }
    .cta-button { margin-right: 0; margin-bottom: 0.5rem; }
    .user-profile-btn { margin-right: 0; }
    .hero h1 { font-size: 2.25rem; }
    .college-building { width: 200px; height: 300px; right: 5%; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .features-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.75rem; }
    .college-building { width: 150px; height: 200px; right: 2%; opacity: 0.1; }
    .section-title { font-size: 1.75rem; }
    .stats-grid { grid-template-columns: 1fr; }
}
