/* MoPol - Custom Styling - Neutral Theme */

/* ==================== Color Variables ==================== */
:root {
    /* Neutral palette */
    --neutral-50: #f9fafb;
    --neutral-100: #f3f4f6;
    --neutral-200: #e5e7eb;
    --neutral-300: #d1d5db;
    --neutral-400: #9ca3af;
    --neutral-500: #6b7280;
    --neutral-600: #4b5563;
    --neutral-700: #374151;
    --neutral-800: #1f2937;
    --neutral-900: #111827;

    /* Slate palette for headers/primary elements */
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;

    /* Semantic colors - minimal use */
    --success: #10b981;
    --success-light: #d1fae5;
    --error: #ef4444;
    --error-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #3b82f6;
    --info-light: #dbeafe;
}

/* ==================== DaisyUI Theme Overrides ==================== */

/* Primary buttons use the theme's primary color; add a subtle shadow for depth */
.btn-primary {
    box-shadow: 0 1px 2px rgba(61, 43, 31, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 2px 6px rgba(61, 43, 31, 0.3);
}

/* ==================== Global Animations ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.content-section {
    animation: fadeIn 0.4s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .content-section,
    .toast-enter,
    .toast-exit {
        animation: none !important;
    }
}

/* ==================== Resident Dashboard ==================== */
.dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--neutral-200);
}

.dashboard-hero h1 {
    margin-top: 0.2rem;
    color: var(--neutral-900);
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 750;
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.dashboard-eyebrow {
    color: #6d4c41;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
}

.dashboard-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.dashboard-section-heading h2 {
    margin-top: 0.2rem;
    color: var(--neutral-900);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.attention-card {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem;
    border: 1px solid #f5d28a;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #fffbeb 0%, #fff 72%);
    box-shadow: 0 1px 2px rgba(120, 53, 15, 0.05);
}

.attention-icon,
.activity-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
}

.attention-icon {
    color: #92400e;
    background: #fef3c7;
}

.attention-icon svg,
.activity-icon svg {
    width: 1.2rem;
    height: 1.2rem;
}

.notice-card,
.quick-links-card,
.community-help-card,
.activity-list {
    border: 1px solid var(--neutral-200);
    border-radius: 0.75rem;
    background: white;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.045);
}

.notice-card {
    position: relative;
    padding: 1.15rem 1.25rem;
    overflow: hidden;
}

.notice-card-pinned {
    border-left: 3px solid #3d2b1f;
    background: linear-gradient(90deg, #faf8f5 0%, #fff 18%);
}

.notice-preview {
    position: relative;
    max-height: 8.5rem;
    overflow: hidden;
}

.notice-preview::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2.5rem;
    content: '';
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff);
}

.notice-card-pinned .notice-preview::after {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff);
}

.quick-links-card,
.community-help-card {
    padding: 1.1rem;
}

.quick-link {
    display: flex;
    flex-direction: column;
    min-height: 3.6rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 0.55rem;
    background: var(--neutral-50);
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.quick-link:hover {
    border-color: #d8c8bb;
    background: #faf8f5;
    transform: translateY(-1px);
}

.quick-link:focus-visible,
.activity-row:focus-visible {
    outline: 2px solid #3d2b1f;
    outline-offset: 2px;
}

.quick-link span {
    color: var(--neutral-800);
    font-size: 0.9rem;
    font-weight: 650;
}

.quick-link small {
    margin-top: 0.1rem;
    color: var(--neutral-500);
    font-size: 0.72rem;
}

.community-help-card {
    background: #faf8f5;
    border-color: #e8ded5;
}

.activity-list {
    overflow: hidden;
}

.activity-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 4.6rem;
    padding: 0.75rem 1rem;
    transition: background-color 0.15s ease;
}

.activity-row:hover {
    background: var(--neutral-50);
}

.activity-icon {
    color: var(--neutral-600);
    background: var(--neutral-100);
}

.activity-icon-voting {
    color: #047857;
    background: #d1fae5;
}

.activity-icon-fault {
    color: #92400e;
    background: #fef3c7;
}

.activity-icon-document {
    color: #1d4ed8;
    background: #dbeafe;
}

.dashboard-empty {
    padding: 2rem;
    border: 1px dashed var(--neutral-300);
    border-radius: 0.75rem;
    color: var(--neutral-500);
    background: rgba(255, 255, 255, 0.65);
    text-align: center;
}

@media (max-width: 639px) {
    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .attention-card {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .attention-card .btn {
        width: 100%;
        margin-left: 3.125rem;
    }

    .notice-card {
        padding: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .quick-link,
    .activity-row {
        transition: none;
    }

    .quick-link:hover {
        transform: none;
    }
}

/* ==================== Section Headers ==================== */
.section-header {
    position: relative;
    padding: 0.875rem 1.25rem;
    border-radius: 0.625rem;
    margin-bottom: 1.25rem;
    background: white;
    border: 1px solid var(--neutral-200);
    border-left: 3px solid #3d2b1f;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.section-header h1 {
    position: relative;
    z-index: 1;
    font-size: 1.375rem;
    line-height: 1.75rem;
    font-weight: 700;
    color: var(--neutral-800);
    letter-spacing: -0.01em;
}

.section-header p {
    position: relative;
    z-index: 1;
    color: var(--neutral-600);
    font-size: 0.875rem;
    margin-top: 0.125rem;
}

/* ==================== Badge Styling ==================== */
/* Shape tweaks only - color comes from DaisyUI variants or the soft set below */
.badge {
    min-height: 1.5rem;
    height: auto;
    white-space: normal;
    line-height: 1.2;
    padding: 0.25rem 0.5rem;
}

/* Soft semantic variants (light bg + dark text) instead of DaisyUI's solid ones */
.badge-success {
    background-color: var(--success-light);
    color: #065f46;
    border-color: #86efac;
}

.badge-error {
    background-color: var(--error-light);
    color: #991b1b;
    border-color: #fca5a5;
}

.badge-warning {
    background-color: var(--warning-light);
    color: #78350f;
    border-color: #fde047;
}

.badge-info {
    background-color: var(--info-light);
    color: #1e40af;
    border-color: #93c5fd;
}

.badge-ghost {
    background-color: var(--neutral-100);
    color: var(--neutral-600);
    border-color: var(--neutral-300);
}

/* ==================== Action Buttons ==================== */

/* .btn-action-edit / .btn-action-delete live in tailwind.css (@layer components) -
   @apply is only valid inside the Tailwind build, not in plain CSS. */

/* ==================== Toast Notifications ==================== */
@keyframes slideInToast {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideOutToast {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100%); opacity: 0; }
}

.toast-enter {
    animation: slideInToast 0.3s ease-out forwards;
}

.toast-exit {
    animation: slideOutToast 0.3s ease-in forwards;
}

/* ==================== Navigation ==================== */
/* Active menu item in the sidebar: chocolate instead of DaisyUI's navy neutral */
.menu a.active {
    background-color: #3d2b1f !important;
    color: white !important;
}

.nav-active {
    position: relative;
    background: rgba(0, 0, 0, 0.05);
}

.nav-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--slate-600);
    border-radius: 0 2px 2px 0;
}

/* ==================== Card Styling ==================== */
.card-neutral {
    background-color: white;
    border: 1px solid var(--neutral-200);
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card-neutral:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}

/* ==================== Apartment Visualization (Owner Management) ==================== */
.apartment-empty {
    background-color: var(--neutral-100);
    border-color: var(--neutral-300);
}

.apartment-single {
    background-color: var(--neutral-50);
    border-color: var(--neutral-400);
}

.apartment-multiple {
    background-color: var(--neutral-100);
    border-color: var(--neutral-500);
}

.apartment-bsm {
    background-color: var(--info-light);
    border-color: #93c5fd;
}

/* ==================== Status Colors (Voting, Email Campaigns) ==================== */
.status-draft {
    background-color: var(--neutral-200);
    color: var(--neutral-700);
}

.status-scheduled,
.status-published {
    background-color: var(--warning-light);
    color: #78350f;
}

.status-active,
.status-sent,
.status-success {
    background-color: var(--success-light);
    color: #065f46;
}

.status-closed,
.status-cancelled {
    background-color: var(--neutral-200);
    color: var(--neutral-600);
}

.status-failed,
.status-error {
    background-color: var(--error-light);
    color: #991b1b;
}

/* ==================== Focus Styling ==================== */
/* .focus-ring lives in tailwind.css (@layer components) -
   @apply is only valid inside the Tailwind build, not in plain CSS. */

/* ==================== Icon Consistency ==================== */
.icon-sm {
    width: 1.25rem;  /* 20px */
    height: 1.25rem;
}

.icon-md {
    width: 1.5rem;  /* 24px */
    height: 1.5rem;
}

.icon-lg {
    width: 2rem;  /* 32px */
    height: 2rem;
}

.icon-neutral {
    color: var(--neutral-600);
}

.icon-error {
    color: var(--error);
}

.icon-success {
    color: var(--success);
}

/* ==================== Inline Editing (Contacts) ==================== */
.email-display {
    position: relative;
    transition: all 0.2s ease;
}

.email-display:hover {
    background-color: var(--neutral-100);
}

.email-display::after {
    content: '✎';
    position: absolute;
    right: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 0.875rem;
    color: var(--neutral-500);
}

.email-display:hover::after {
    opacity: 0.5;
}

.email-input {
    transition: all 0.2s ease;
}

.email-input:focus {
    border-color: var(--slate-600);
    box-shadow: 0 0 0 2px rgba(71, 85, 105, 0.1);
}

.clear-btn {
    transition: opacity 0.2s ease;
}

/* ==================== Dashboard Stats Cards ==================== */
.stats-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--neutral-200);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stats-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--neutral-700);
    margin-bottom: 0.5rem;
}

.stats-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--neutral-900);
}

.stats-card-subtitle {
    font-size: 0.875rem;
    color: var(--neutral-600);
    margin-top: 0.25rem;
}

/* ==================== Building Facade (Owner Management) ==================== */
.apt-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 2.75rem;      /* 44px */
    height: 2.75rem;
    border-radius: 0.5rem;
    border: 1.5px solid var(--neutral-300);
    background: white;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.apt-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
    z-index: 5;
}

.apt-cell .apt-number {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    color: var(--neutral-800);
}

.apt-cell .apt-sub {
    font-size: 0.625rem;
    color: var(--neutral-500);
    margin-top: 2px;
    line-height: 1;
}

/* Status tints */
.apt-empty {
    border-style: dashed;
    background: var(--neutral-50);
}

.apt-single {
    border-color: #1d4ed8;
    background: #eef2ff;
}

.apt-multiple {
    border-color: var(--neutral-400);
    background: var(--neutral-100);
}

.apt-bsm {
    border-color: #93c5fd;
    background: var(--info-light);
}

/* Entrance column header ("roof") - bronze/brown accents of the actual building */
.entrance-roof {
    background: linear-gradient(180deg, #6d4c41 0%, #5d4037 100%);
    color: white;
    border-radius: 0.5rem 0.5rem 0 0;
}

/* Ground-floor door */
.entrance-door {
    color: #6d4c41;
}

/* ==================== Contact-data reminder ==================== */
.contact-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background: var(--warning);
    border: 2px solid white;
    animation: contactPulse 2.5s ease-in-out infinite;
}

@keyframes contactPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.45); }
    50% { box-shadow: 0 0 0 5px rgba(245, 158, 11, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .contact-dot { animation: none; }
}
