:root {
    --bg-dark: #09090b;
    --bg-card: rgba(24, 24, 27, 0.6);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --success: #22c55e;
}

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

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
}

.dashboard-header {
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content h1 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.datetime {
    font-size: 0.9rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
}

.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn.primary {
    background: var(--accent);
    color: white;
}

.btn.primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    border-radius: 6px;
}

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

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

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    transition: transform 0.3s ease;
    margin: 1rem;
}

.modal-overlay.hidden .modal {
    transform: translateY(20px);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.hidden {
    display: none;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group input, .form-group select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--accent);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group select option {
    background: var(--bg-dark);
    color: var(--text-main);
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Card Styles */
.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    cursor: grab;
}

.dashboard-card-ghost {
    opacity: 0.4;
    background: var(--border-color);
}

.dashboard-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.dashboard-card:active {
    cursor: grabbing;
}

.card-header {
    padding: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title i {
    color: var(--accent);
}

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

.card-body {
    padding: 1.2rem;
    flex: 1;
    min-height: 150px;
    max-height: 400px;
    overflow-y: auto;
}

/* Scrollbar styling for card body */
.card-body::-webkit-scrollbar {
    width: 6px;
}
.card-body::-webkit-scrollbar-track {
    background: transparent;
}
.card-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.card-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.card-footer {
    padding: 0.8rem 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
}

/* Specific Card Layouts */
.user-profile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.user-profile img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}
.user-details h3 {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}
.user-details p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.user-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}
.user-stats span {
    background: rgba(255,255,255,0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.list-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.list-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.list-item:first-child {
    padding-top: 0;
}
.list-item-icon {
    color: var(--text-muted);
    margin-top: 0.2rem;
    font-size: 1.2rem;
}
.list-item-content {
    flex: 1;
    min-width: 0; /* for text truncation */
}
.list-item-content h4 {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-item-content p {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.list-item-content a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s;
}
.list-item-content a:hover {
    color: var(--accent);
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    color: var(--accent);
    font-size: 2rem;
}
.loading-spinner i {
    animation: spin 1s linear infinite;
}

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

.error-message {
    color: var(--danger);
    text-align: center;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    font-size: 0.9rem;
}

.grid-cols-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* User follower list specific */
.follower-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    transition: background 0.2s;
}
.follower-item:hover {
    background: rgba(255,255,255,0.08);
}
.follower-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}
.follower-item a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
    vertical-align: middle;
}
.status-open { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.status-closed { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.status-merged { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.empty-state i {
    font-size: 2rem;
    opacity: 0.5;
}

/* Chart Canvas Wrapper */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

/* Animations */
@keyframes createZoom {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes createFade {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes updateRotate {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(2deg) scale(1.02); }
    50% { transform: rotate(-2deg) scale(1.02); }
    75% { transform: rotate(1deg) scale(1.02); }
    100% { transform: rotate(0deg); }
}
@keyframes updateShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

.anim-create-zoom { animation: createZoom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.anim-create-fade { animation: createFade 0.5s ease forwards; }
.anim-update-rotate { animation: updateRotate 0.5s ease; }
.anim-update-shake { animation: updateShake 0.4s ease; }

/* Maximized Card */
.dashboard-card.maximized {
    position: fixed !important;
    top: 5vh;
    left: 5vw;
    width: 90vw;
    height: 90vh;
    z-index: 1050;
    margin: 0;
    transform: none !important;
}
.dashboard-card.maximized .card-body {
    max-height: calc(90vh - 120px);
}
