@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* ============================================
   POSTIVO MODERN STYLING - 2024
   Gradient-based design matching Identity pages
   ============================================ */

/* Base Typography */
html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
}

h1:focus {
    outline: none;
}

/* ============================================
   POSTIVO BRAND COLORS
   ============================================ */
:root {
    --postivo-purple: #667eea;
    --postivo-violet: #764ba2;
    --postivo-cyan: #00c4cc;
    --postivo-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --postivo-light-bg: #f8f9fa;
    --postivo-border: #e0e0e0;
}

/* ============================================
   CALENDAR STYLING
   ============================================ */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
}

.calendar-header-row {
    display: contents;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    padding: 10px;
    color: #495057;
    font-size: 0.875rem;
}

.calendar-day {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px;
    min-height: 70px;
    position: relative;
    transition: all 0.2s ease;
}

.calendar-day:hover {
    background: #f0f7ff;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.15);
}

.calendar-day.other-month {
    background: #f8f9fa;
    opacity: 0.5;
}

.calendar-day.today {
    border: 2px solid #667eea;
    background: linear-gradient(135deg, #f0f7ff 0%, #fff 100%);
}

.calendar-day.past {
    background: #f8f9fa;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.calendar-day.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.calendar-day.selected .calendar-day-number {
    color: white;
}

.calendar-day-number {
    font-weight: 600;
    font-size: 0.875rem;
    color: #212529;
}

.calendar-day-posts {
    position: absolute;
    bottom: 4px;
    right: 4px;
}

.calendar-day-posts .badge {
    font-size: 0.7rem;
    padding: 2px 6px;
}

/* ============================================
   PRODUCT SEARCH DROPDOWN
   ============================================ */
.product-search-input {
    border: 2px solid var(--postivo-border);
    transition: border-color 0.3s ease;
}

.product-search-input:focus {
    border-color: var(--postivo-purple);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.product-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--postivo-border);
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
}

.product-dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.product-dropdown-item:last-child {
    border-bottom: none;
}

.product-dropdown-item:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

.product-dropdown-item:active {
    background-color: rgba(102, 126, 234, 0.1);
}

.product-dropdown-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--postivo-border);
}

.product-dropdown-footer {
    padding: 8px 16px;
    background-color: #f8f9fa;
    border-top: 1px solid var(--postivo-border);
    text-align: center;
}

/* ============================================
   BUTTONS & LINKS
   ============================================ */
a {
    color: var(--postivo-purple);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--postivo-violet);
    text-decoration: none;
}

.btn-link {
    color: var(--postivo-purple);
}

.btn-primary {
    background: var(--postivo-gradient);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
    color: #fff;
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.5);
}

.btn-outline-primary {
    border-color: var(--postivo-purple);
    color: var(--postivo-purple);
}

.btn-outline-primary:hover {
    background-color: var(--postivo-purple);
    border-color: var(--postivo-purple);
    color: #fff;
}

/* ============================================
   CARDS & CONTAINERS
   ============================================ */
.card {
    border-radius: 12px;
    border: 1px solid var(--postivo-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: var(--postivo-light-bg);
    border-bottom: 1px solid var(--postivo-border);
    border-radius: 12px 12px 0 0 !important;
}

/* ============================================
   FORMS
   ============================================ */
.form-control:focus {
    border-color: var(--postivo-purple);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-select:focus {
    border-color: var(--postivo-purple);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-check-input:checked {
    background-color: var(--postivo-purple);
    border-color: var(--postivo-purple);
}

.form-check-input:focus {
    border-color: var(--postivo-purple);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.valid.modified:not([type=checkbox]) {
    outline: 2px solid #26b050;
}

.invalid {
    outline: 2px solid #dc3545;
}

.validation-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ============================================
   CONTENT AREA
   ============================================ */
.content {
    padding: 2rem;
    min-height: calc(100vh - 60px);
}

.main {
    flex: 1;
    padding: 0;
}

@media (max-width: 768px) {
    .content {
        padding: 1rem;
    }
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    border-radius: 6px;
    padding: 0.35em 0.65em;
    font-weight: 600;
}

.bg-primary {
    background: var(--postivo-gradient) !important;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.25rem;
}

.alert-primary {
    background-color: rgba(102, 126, 234, 0.1);
    color: var(--postivo-purple);
}

.alert-info {
    background-color: rgba(0, 196, 204, 0.1);
    color: var(--postivo-cyan);
}

/* ============================================
   BLAZOR ERROR UI
   ============================================ */
#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.8rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    border-top: 3px solid #ffc107;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.8rem;
    font-weight: bold;
    color: #856404;
}

.blazor-error-boundary {
    background: linear-gradient(90deg, #dc3545 0%, #c82333 100%);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 8px;
    margin: 1rem 0;
    position: relative;
}

.blazor-error-boundary::before {
    content: "?";
    position: absolute;
    left: 1rem;
    font-size: 2rem;
}

.blazor-error-boundary::after {
    content: "Er is een fout opgetreden."
}

/* ============================================
   SPINNER / LOADING
   ============================================ */
.spinner-border {
    border-color: var(--postivo-purple);
    border-right-color: transparent;
}

/* ============================================
   TABLES
   ============================================ */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: var(--postivo-light-bg);
    border-bottom: 2px solid var(--postivo-border);
    font-weight: 600;
    color: #333;
}

.table-hover tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* ============================================
   HOVER EFFECTS
   ============================================ */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

/* ============================================
   TEXT UTILITIES
   ============================================ */
.text-primary {
    color: var(--postivo-purple) !important;
}

.text-primary-custom {
    color: var(--postivo-cyan) !important;
}

/* ============================================
   MODAL
   ============================================ */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: var(--postivo-gradient);
    color: white;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav-link {
    color: #333;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--postivo-purple);
}

.nav-link.active {
    color: var(--postivo-purple);
    font-weight: 600;
}

/* ============================================
   SIDEBAR NAVIGATION (MainLayout)
   ============================================ */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, var(--postivo-purple) 0%, var(--postivo-violet) 100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.top-row {
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 3.5rem;
    display: flex;
    align-items: center;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: white !important;
}

.oi {
    width: 1.5rem;
    font-size: 1.1rem;
    vertical-align: text-top;
    top: -2px;
}

.nav-item {
    font-size: 0.9rem;
}

/* Sidebar nav-item specific styles */
.sidebar .nav-item {
    padding-bottom: 0.5rem;
}

.sidebar .nav-item:first-of-type {
    padding-top: 1rem;
}

.sidebar .nav-item:last-of-type {
    padding-bottom: 1rem;
}

.sidebar .nav-item ::deep a {
    color: white !important;
    border-radius: 6px;
    height: 3rem;
    display: flex;
    align-items: center;
    line-height: 3rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar .nav-item ::deep a.active {
    background-color: rgba(255, 255, 255, 0.25);
    color: white !important;
    font-weight: 600;
}

.sidebar .nav-item ::deep a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white !important;
}

/* Tab navigation styles (for Billing page tabs, etc.) */
.nav-tabs .nav-item {
    padding-bottom: 0;
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    border: 1px solid transparent;
    border-radius: 0.375rem 0.375rem 0 0;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    border-color: var(--postivo-border);
    background-color: rgba(102, 126, 234, 0.05);
}

.nav-tabs .nav-link.active {
    background: var(--postivo-gradient);
    color: white !important;
    border-color: var(--postivo-purple);
    font-weight: 600;
}

.nav-tabs {
    border-bottom: 2px solid var(--postivo-border);
}

.nav-scrollable {
    overflow-y: auto;
    height: 100%;
}

/* Ensure all nav items have white text */
.sidebar .nav-item a,
.sidebar .nav-item button,
.sidebar .nav-item .nav-link {
    color: white !important;
}

.sidebar .nav-item span {
    color: white !important;
}

.sidebar .navbar-brand {
    color: white !important;
}

/* Desktop: Sidebar always visible */
@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 260px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    /* CRITICAL: On desktop, always show sidebar content - override Bootstrap collapse */
    .sidebar .nav-scrollable.collapse {
        display: block !important;
        visibility: visible !important;
        height: auto !important;
    }

    .page > main {
        flex: 1;
        padding: 1rem;
    }

    .navbar-toggler {
        display: none;
    }

    .sidebar .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }
}

/* Mobile: Sidebar collapsible */
@media (max-width: 640.98px) {
    .page {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar .collapse {
        display: none;
    }

    .sidebar .collapse.show {
        display: block;
    }

    .navbar-toggler {
        display: block;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1030;
    }
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 576px) {
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--postivo-light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--postivo-purple);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--postivo-violet);
}
