:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(15, 23, 42, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
}

/* Background Mesh */
.bg-mesh {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    background: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
    background-color: var(--bg-color);
    background-size: 100% 100%;
}

.bg-mesh::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at center, black, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at center, black, transparent 80%);
}

#app {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    z-index: 1;
}

.view {
    display: none;
    width: 100%;
    animation: smoothFade 0.5s ease forwards;
}

.view.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#login-view {
    min-height: 80vh;
    justify-content: center;
}

/* Glassmorphism Cards */
.card {
    background-color: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--glass-shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.projects-card {
    max-width: 100%;
    margin-top: 2rem;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.section-title {
    font-size: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.input-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color 0.3s;
}

input, select {
    width: 100%;
    padding: 0.85rem 1rem;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), inset 0 2px 4px rgba(0,0,0,0.1);
}

.input-group:focus-within label {
    color: var(--accent-color);
}

.input-error input {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15) !important;
}

small {
    color: var(--text-secondary);
    font-size: 0.8rem;
    transition: color 0.3s;
}

.mt-2 { margin-top: 2rem; }

/* Buttons */
.btn {
    width: 100%;
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn.primary {
    background: linear-gradient(135deg, var(--accent-color), #4f46e5);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.glow-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn.primary:disabled {
    background: var(--border-color);
    box-shadow: none;
    cursor: not-allowed;
    color: var(--text-secondary);
}

.btn.outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: auto;
}

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

.btn.danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn.danger:hover {
    background-color: var(--danger-color);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn.icon-btn {
    width: auto;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem;
    border-radius: 0.5rem;
}

.btn.icon-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.spin-on-hover:hover svg {
    animation: spin 1s linear infinite;
}

/* Dashboard Layout */
.dashboard-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-content {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .dashboard-content {
        grid-template-columns: 380px 1fr;
        align-items: start;
    }
    .projects-card {
        margin-top: 0;
    }
}

/* Projects List */
.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

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

.project-item {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.project-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: var(--accent-color);
    opacity: 0;
    transition: opacity 0.3s;
}

.project-item:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    background-color: rgba(30, 41, 59, 0.9);
}

.project-item:hover::before {
    opacity: 1;
}

.project-info h4 {
    margin-bottom: 0.3rem;
    font-size: 1.1rem;
}

.project-info a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    transition: color 0.2s;
}

.project-info a:hover {
    color: #60a5fa;
    text-decoration: underline;
}

.project-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Skeleton Loaders */
.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skeleton-item {
    height: 80px;
    background: linear-gradient(90deg, var(--input-bg) 25%, rgba(255,255,255,0.05) 50%, var(--input-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-icon {
    font-size: 3rem;
    opacity: 0.5;
}

/* Custom Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--glass-shadow);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.show .modal-card {
    transform: scale(1) translateY(0);
}

.modal-desc {
    color: var(--text-secondary);
    margin: 1rem 0 1.5rem 0;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 200;
}

.toast {
    min-width: 250px;
    max-width: 350px;
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
}

.toast.show {
    transform: translateX(0);
}

.toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    font-size: 1.2rem;
}

.toast.success { border-left: 4px solid var(--success-color); }
.toast.error { border-left: 4px solid var(--danger-color); }
.toast.info { border-left: 4px solid var(--accent-color); }

/* Utilities */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

@keyframes smoothFade {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
