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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    text-align: center;
}

.login-card {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 12px;
    padding: 3rem;
    min-width: 320px;
}

.login-card h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.tagline {
    color: #888;
    margin-bottom: 2rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 1rem;
}

.login-form input {
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #2a2a4a;
    background: #0f0f23;
    color: #e0e0e0;
    font-size: 0.95rem;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-full { width: 100%; padding: 12px; font-size: 1rem; }

.register-link {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #888;
}

.register-link a {
    color: #667eea;
    text-decoration: none;
}

.register-link a:hover { text-decoration: underline; }

.google-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    color: #333;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    width: 100%;
    justify-content: center;
    transition: box-shadow 0.2s;
}

.google-btn:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: #666;
    font-size: 0.85rem;
}

.divider::before, .divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #2a2a4a;
}

.divider span { padding: 0 12px; }

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #1a1a2e;
    border-bottom: 1px solid #2a2a4a;
}

.nav-left h2 {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.user-name {
    font-size: 0.9rem;
    color: #aaa;
}

.container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.upload-section {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.upload-section h3 {
    margin-bottom: 1rem;
}

.upload-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.upload-form input[type="file"] {
    flex: 1;
    color: #ccc;
}

.hint {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
}

.files-section {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 1.5rem;
}

.files-section h3 {
    margin-bottom: 1rem;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
}

.file-table th,
.file-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #2a2a4a;
}

.file-table th {
    color: #888;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.actions {
    display: flex;
    gap: 8px;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    background: #2a2a4a;
    color: #e0e0e0;
    transition: background 0.2s;
}

.btn:hover { background: #3a3a5a; }

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.btn-primary:hover { opacity: 0.9; }

.btn-sm { padding: 5px 10px; font-size: 0.8rem; }

.btn-switch { background: #1a4a3a; color: #6bffc0; }
.btn-switch:hover { background: #2a5a4a; }

.btn-sync {
    background: #1a3a4a;
    color: #6bcfff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-sync:hover { background: #2a4a5a; }

@keyframes spin {
    from { transform: rotate(-90deg); }
    to { transform: rotate(270deg); }
}

.nav-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #667eea;
    text-decoration: none;
    transition: border-color 0.2s;
}

.nav-avatar:hover { border-color: #764ba2; }

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #667eea;
}

.avatar-img-large {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder-large {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 700;
    font-size: 2.5rem;
}

.btn-info {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    padding: 0;
    font-style: italic;
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    line-height: 26px;
    background: #2a2a4a;
    color: #667eea;
    border: 1px solid #667eea;
}

.btn-info:hover { background: #667eea; color: #fff; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover { color: #fff; }

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 8px 0;
    border-bottom: 1px solid #2a2a4a;
    font-size: 0.9rem;
    color: #ccc;
}

.feature-list li:last-child { border-bottom: none; }
.feature-list li strong { color: #e0e0e0; }

.btn-manage-links {
    margin-left: 12px;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.quick-link[draggable="true"] { cursor: grab; }
.quick-link[draggable="true"]:active { cursor: grabbing; }

.toggle-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}

.toggle-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    cursor: pointer;
}

.user-list { display: flex; flex-direction: column; gap: 10px; margin-top: 1.5rem; }

.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #2a2a4a;
    text-decoration: none;
    color: #e0e0e0;
    transition: background 0.2s;
}

.user-item:hover { background: #3a3a5a; }
.user-item.active { border: 1px solid #667eea; background: #1a2a4a; }

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; text-align: left; }
.user-item-name { font-weight: 600; font-size: 0.95rem; }
.user-item-email { font-size: 0.75rem; color: #888; }

.active-badge {
    margin-left: auto;
    font-size: 0.7rem;
    background: #667eea;
    color: #fff;
    padding: 3px 8px;
    border-radius: 10px;
}

.btn-view { background: #1a3a4a; color: #6bcfff; }
.btn-view:hover { background: #2a4a5a; }

.btn-danger { background: #4a1a1a; color: #ff6b6b; }
.btn-danger:hover { background: #5a2a2a; }

.flash {
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.flash.success { background: #1a3a1a; color: #6bff6b; border: 1px solid #2a4a2a; }
.flash.error { background: #3a1a1a; color: #ff6b6b; border: 1px solid #4a2a2a; }

.empty-state {
    text-align: center;
    color: #666;
    padding: 2rem;
}

/* Dashboard background */
.dashboard-bg {
    min-height: 100vh;
    background: url('https://images.unsplash.com/photo-1534796636912-3b95b3ab5986?w=1920&q=85') center/cover no-repeat fixed;
    position: relative;
}

.dashboard-bg::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 35, 0.7);
    z-index: 0;
}

.dashboard-bg .navbar,
.dashboard-bg .container {
    position: relative;
    z-index: 1;
}

/* Sections grid */
.section-title {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.section-card {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    text-decoration: none;
    color: #e0e0e0;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    border-top: 4px solid var(--card-color);
}

.section-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: var(--card-color);
}

.section-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--card-color);
}

.section-icon svg {
    width: 100%;
    height: 100%;
}

.section-label {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Section banner */
.section-banner {
    background: linear-gradient(135deg, var(--card-color), transparent);
    opacity: 0.15;
    height: 80px;
    position: relative;
}

.banner-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    color: #fff;
    opacity: 0.7;
}

.banner-icon svg {
    width: 100%;
    height: 100%;
}

/* Back link */
.back-link {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 1.5rem;
    margin-right: 12px;
}

.back-link:hover { color: #fff; }

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Quick Links */
.links-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.quick-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 50%;
    color: var(--link-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.quick-link:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.quick-link svg {
    width: 28px;
    height: 28px;
}

/* Settings */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-card {
    display: block;
    padding: 1rem 1.25rem;
    background: #0f0f23;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.radio-card:hover { border-color: #667eea; }
.radio-card.active { border-color: #667eea; background: #1a1a3e; }

.radio-card input { margin-right: 10px; }

.radio-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.radio-desc {
    display: block;
    margin-top: 4px;
    margin-left: 24px;
    font-size: 0.8rem;
    color: #888;
}
