/**
 * Sakin Dashboard CSS - Premium Dark Theme
 * Kozan Apartman Yönetim Sistemi
 */

:root {
    --sakin-primary: #6366f1;
    --sakin-primary-light: #818cf8;
    --sakin-primary-dark: #4f46e5;
    --sakin-success: #10b981;
    --sakin-warning: #f59e0b;
    --sakin-danger: #ef4444;
    --sakin-info: #22d3ee;
    --sakin-bg-dark: #0a0e17;
    --sakin-bg-card: rgba(15, 22, 41, 0.8);
    --sakin-border: rgba(255, 255, 255, 0.08);
    --sakin-text: #f1f5f9;
    --sakin-text-muted: #94a3b8;
}

/* ==========================================================================
   Dashboard Container
   ========================================================================== */
.sakin-dashboard {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* ==========================================================================
   Welcome Card - Glassmorphism
   ========================================================================== */
.welcome-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(34, 211, 238, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.welcome-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-subtitle {
    color: var(--sakin-text-muted);
    font-size: 1rem;
}

/* User Info Badges */
.user-info-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 50px;
    font-size: 0.85rem;
    color: #a5b4fc;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.user-info-badge:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
}

/* ==========================================================================
   Stat Cards
   ========================================================================== */
.stat-card {
    background: var(--sakin-bg-card);
    border: 1px solid var(--sakin-border);
    border-radius: 20px;
    padding: 1.5rem;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--sakin-primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.stat-icon.primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.08));
    color: #a5b4fc;
}

.stat-icon.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.08));
    color: #6ee7b7;
}

.stat-icon.warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.08));
    color: #fcd34d;
}

.stat-icon.danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.08));
    color: #fca5a5;
}

.stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--sakin-text);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--sakin-text-muted);
}

/* ==========================================================================
   Section Cards
   ========================================================================== */
.section-card {
    background: var(--sakin-bg-card);
    border: 1px solid var(--sakin-border);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.section-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--sakin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--sakin-text);
}

.section-body {
    padding: 1.5rem;
}

/* ==========================================================================
   Invoice List
   ========================================================================== */
.invoice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.invoice-item:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
}

.invoice-item:last-child {
    margin-bottom: 0;
}

.invoice-info h6 {
    margin: 0 0 0.25rem;
    font-weight: 600;
    color: var(--sakin-text);
}

.invoice-info small {
    color: var(--sakin-text-muted);
}

.invoice-amount {
    text-align: right;
}

.invoice-amount .amount {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--sakin-text);
}

/* ==========================================================================
   Status Badges
   ========================================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.status-badge.paid {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.status-badge.overdue {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ==========================================================================
   Quick Actions
   ========================================================================== */
.quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--sakin-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--sakin-text);
    transition: all 0.3s ease;
}

.quick-action:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
    color: white;
    transform: translateX(5px);
}

.quick-action-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.08));
    color: #a5b4fc;
}

/* ==========================================================================
   Apartment Stats
   ========================================================================== */
.apt-stat-item {
    text-align: center;
    padding: 1rem;
}

.apt-stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.apt-stat-label {
    font-size: 0.8rem;
    color: var(--sakin-text-muted);
}

/* ==========================================================================
   Announcements
   ========================================================================== */
.announcement-item {
    padding: 1rem;
    background: rgba(139, 92, 246, 0.08);
    border-left: 3px solid #8b5cf6;
    border-radius: 0 12px 12px 0;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.announcement-item:hover {
    background: rgba(139, 92, 246, 0.12);
}

.announcement-item:last-child {
    margin-bottom: 0;
}

.announcement-item h6 {
    margin: 0 0 0.5rem;
    font-weight: 600;
    color: var(--sakin-text);
}

.announcement-item p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--sakin-text-muted);
    line-height: 1.5;
}

.announcement-date {
    font-size: 0.75rem;
    color: #8b5cf6;
    margin-top: 0.5rem;
}

/* ==========================================================================
   Empty State
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--sakin-text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card,
.section-card {
    animation: fadeInUp 0.5s ease forwards;
}

.stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.15s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.25s;
}

/* ==========================================================================
   MOBILE-FIRST RESPONSIVE DESIGN
   Base: Mobile (320px-480px)
   ========================================================================== */

/* Mobile Base - Compact Everything */
.sakin-dashboard {
    padding: 0.75rem 0;
}

.welcome-card {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.welcome-card::before {
    display: none;
    /* Hide decorative circle on mobile */
}

.welcome-title {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.welcome-subtitle {
    font-size: 0.85rem;
}

.user-info-badge {
    padding: 5px 10px;
    font-size: 0.75rem;
    gap: 5px;
}

/* Stat Cards - Compact 2x2 Grid on Mobile */
.stat-card {
    padding: 0.75rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.stat-card:hover {
    transform: none;
    /* Disable hover transform on mobile */
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.25rem;
}

.stat-label {
    font-size: 0.75rem;
}

/* Section Cards - Compact */
.section-card {
    border-radius: 12px;
    margin-bottom: 1rem;
}

.section-header {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.section-title {
    font-size: 0.95rem;
}

.section-body {
    padding: 0.75rem;
}

/* Invoice Items - Stack Vertically */
.invoice-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem;
    gap: 0.5rem;
}

.invoice-info h6 {
    font-size: 0.9rem;
}

.invoice-info small {
    font-size: 0.75rem;
}

.invoice-amount {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.invoice-amount .amount {
    font-size: 1rem;
}

/* Quick Actions - Compact */
.quick-action {
    padding: 0.75rem;
    gap: 10px;
}

.quick-action:hover {
    transform: none;
}

.quick-action-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

.quick-action strong {
    font-size: 0.9rem;
}

.quick-action small {
    font-size: 0.75rem;
}

/* Apartment Stats */
.apt-stat-item {
    padding: 0.5rem;
}

.apt-stat-value {
    font-size: 1.1rem;
}

.apt-stat-label {
    font-size: 0.7rem;
}

/* Announcements */
.announcement-item {
    padding: 0.75rem;
}

.announcement-item h6 {
    font-size: 0.9rem;
}

.announcement-item p {
    font-size: 0.8rem;
}

/* Empty State */
.empty-state {
    padding: 1.5rem;
}

.empty-state i {
    font-size: 2rem;
}

/* Reduce animations on mobile */
@media (prefers-reduced-motion: reduce) {

    .stat-card,
    .section-card {
        animation: none;
    }
}

/* ==========================================================================
   Tablet (min-width: 768px)
   ========================================================================== */
@media (min-width: 768px) {
    .sakin-dashboard {
        padding: 1.5rem 0;
    }

    .welcome-card {
        padding: 1.5rem;
        border-radius: 20px;
        margin-bottom: 1.5rem;
    }

    .welcome-card::before {
        display: block;
    }

    .welcome-title {
        font-size: 1.5rem;
    }

    .stat-card {
        padding: 1.25rem;
        border-radius: 16px;
    }

    .stat-card:hover {
        transform: translateY(-3px);
    }

    .stat-icon {
        width: 44px;
        height: 44px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .section-card {
        border-radius: 16px;
    }

    .section-header {
        padding: 1rem 1.25rem;
    }

    .section-body {
        padding: 1rem;
    }

    .invoice-item {
        flex-direction: row;
        align-items: center;
        padding: 1rem;
    }

    .invoice-amount {
        text-align: right;
        width: auto;
        display: block;
    }

    .quick-action:hover {
        transform: translateX(5px);
    }
}

/* ==========================================================================
   Desktop (min-width: 1024px)
   ========================================================================== */
@media (min-width: 1024px) {
    .sakin-dashboard {
        padding: 2rem 0;
    }

    .welcome-card {
        padding: 2rem;
        border-radius: 24px;
        margin-bottom: 2rem;
    }

    .welcome-title {
        font-size: 1.75rem;
    }

    .stat-card {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .stat-card:hover {
        transform: translateY(-5px);
    }

    .stat-icon {
        width: 52px;
        height: 52px;
        font-size: 1.3rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .section-card {
        border-radius: 20px;
    }

    .section-header {
        padding: 1.25rem 1.5rem;
    }

    .section-body {
        padding: 1.5rem;
    }
}