:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.85);
    --menu-bg: rgba(15, 23, 42, 0.8); /* 80% opacity */
    --topbar-bg: rgba(30, 41, 59, 0.95);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --border: rgba(255, 255, 255, 0.1);
    --topbar-height: 64px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Loader */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loader-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Topbar */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.topbar-right {
    display: flex;
    gap: 16px;
    align-items: center;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.icon-btn svg {
    width: 24px;
    height: 24px;
}

/* Slide Menu */
.slide-menu {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--topbar-height));
    background: var(--menu-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    z-index: 900;
    padding: 40px 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.slide-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.menu-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 1200px;
    padding: 0 24px;
}

.menu-item {
    width: 100%;
    text-align: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    font-weight: 500;
    padding: 16px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    transform: scale(1.05);
}

/* Main Content Area */
.console-content {
    margin-top: var(--topbar-height);
    height: calc(100vh - var(--topbar-height));
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    flex: 1;
}

.empty-icon {
    width: 72px;
    height: 72px;
    margin-bottom: 24px;
    opacity: 0.6;
}

.empty-state h2 {
    color: var(--text-main);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 32px;
}

.primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

.primary-btn svg {
    width: 22px;
    height: 22px;
}

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

.projects-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease;
}

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

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    width: 100%;
}

.projects-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
}

.header-create-btn {
    padding: 10px 20px;
    font-size: 1rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    width: 100%;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -10px rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.card-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-main);
}

.card-id {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: monospace;
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.role-badge.shared {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.card-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 3 Dots Menu */
.more-options-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s, color 0.2s;
}

.more-options-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
}

.dropdown-menu {
    position: absolute;
    top: 50px;
    right: 20px;
    background: var(--menu-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    min-width: 140px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.dropdown-menu.show {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 12px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:first-child { border-top-left-radius: 12px; border-top-right-radius: 12px; }
.dropdown-item:last-child { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }

.dropdown-item:hover {
    background: rgba(255,255,255,0.05);
}

.dropdown-item.danger {
    color: #ef4444;
}
.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Menu Profile (Top) */
.menu-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
    text-align: center;
    width: 100%;
}

.avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.avatar svg {
    width: 40px;
    height: 40px;
}

.menu-profile-info h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.025em;
}

.email-text {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.join-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
    opacity: 0.7;
}

/* Menu Footer (Bottom) */
.menu-footer {
    margin-top: 40px;
    width: 100%;
    max-width: 250px;
}

.logout-btn {
    width: 100%;
    padding: 14px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #ef4444;
    color: white;
}

/* Responsive Overrides (if any) */
@media (max-width: 768px) {
    .menu-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .menu-item {
        font-size: 1.1rem;
        padding: 12px 10px;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
}

.close-modal-btn {
    opacity: 0.5;
}

.close-modal-btn:hover {
    opacity: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.08);
}

.form-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.options-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 30px;
}

.option-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-main);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #3b82f6;
    cursor: pointer;
}

.small-input {
    padding: 10px 14px;
    font-size: 0.9rem;
    width: 100%;
}

.submit-project-btn {
    width: 100%;
    justify-content: center;
    padding: 16px;
}

/* Alert Buttons */
.primary-btn.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    box-shadow: none;
}
.primary-btn.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}
.primary-btn.danger-btn {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}
.primary-btn.danger-btn:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5);
}
