/**
 * Reportes Dashboard Styles
 * Dashboard-style layout matching the mockup design
 * 
 * @package Bootscore_Child
 * @since 1.0.0
 */

/* ========================================
   PUCP Brand Colors & Variables
   ======================================== */
:root {
    --pucp-primary: #003B71;
    --pucp-primary-dark: #002347;
    --pucp-primary-light: #1a5a9e;
    --pucp-secondary: #00A0DC;
    --pucp-accent: #F7941D;
    --pucp-gold: #C4A35A;
    --pucp-gradient: linear-gradient(135deg, var(--pucp-primary) 0%, var(--pucp-primary-dark) 100%);
}

/* ========================================
   Dashboard Layout - Full Viewport
   ======================================== */
.rdb-dashboard {
    position: relative;
    min-height: calc(100vh - 80px);
    display: flex;
    overflow: hidden;
}

/* Background */
.rdb-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.rdb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(0, 59, 113, 0.88) 0%,
            rgba(0, 35, 71, 0.82) 50%,
            rgba(0, 59, 113, 0.75) 100%);
    z-index: 1;
}

/* Main Layout: Sidebar + Content */
.rdb-layout {
    position: relative;
    z-index: 2;
    width: 100%;
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: calc(100vh - 80px);
}

/* ========================================
   Left Sidebar
   ======================================== */
.rdb-sidebar {
    background: var(--pucp-primary-dark);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
}

.rdb-sidebar-inner {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rdb-sidebar-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.12);
}

.rdb-sidebar-body {
    flex: 1;
}

.rdb-sidebar-subtitle {
    font-size: 0.9375rem;
    color: #ffffff;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.rdb-sidebar-text {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 0.75rem 0;
    line-height: 1.6;
}

.rdb-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-top: 1.5rem;
}

.rdb-sidebar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    text-align: center;
    justify-content: center;
}

.rdb-sidebar-btn--back {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.rdb-sidebar-btn--back:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.rdb-sidebar-btn--alt {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.rdb-sidebar-btn--alt:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* ========================================
   Main Dashboard Area
   ======================================== */
.rdb-main {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Dashboard Header */
.rdb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(0, 59, 113, 0.6);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.rdb-header-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.rdb-header-badge {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #ffffff;
    font-size: 1.125rem;
}

/* ========================================
   Dashboard Content: Category Rows
   ======================================== */
.rdb-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
}

/* Category Row */
.rdb-category-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1rem;
    align-items: start;
    animation: rdbFadeIn 0.5s ease-out both;
}

.rdb-category-row:nth-child(1) {
    animation-delay: 0.1s;
}

.rdb-category-row:nth-child(2) {
    animation-delay: 0.2s;
}

.rdb-category-row:nth-child(3) {
    animation-delay: 0.3s;
}

/* Category Label (Left side of each row) */
.rdb-category-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 0.5rem;
    gap: 0.5rem;
}

.rdb-category-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 0.75rem;
    color: #ffffff;
    font-size: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rdb-category-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

/* Report Cards Row */
.rdb-cards-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: stretch;
}

/* ========================================
   Individual Report Cards
   ======================================== */
.rdb-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 0.625rem;
    padding: 0.875rem 1rem;
    min-width: 150px;
    max-width: 200px;
    flex: 1 1 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.625rem;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.rdb-card--active {
    cursor: pointer;
}

.rdb-card--active:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: var(--pucp-accent);
}

.rdb-card--disabled {
    opacity: 0.55;
    cursor: default;
}

.rdb-card-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--pucp-primary);
    margin: 0;
    line-height: 1.4;
}

/* Card button */
.rdb-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.875rem;
    border-radius: 2rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.rdb-open-report {
    background: var(--pucp-primary);
    color: #ffffff;
}

.rdb-card--active:hover .rdb-open-report {
    background: var(--pucp-accent);
    transform: scale(1.05);
}

.rdb-card-btn--soon {
    background: #e2e8f0;
    color: #94a3b8;
    font-size: 0.625rem;
    cursor: default;
}

/* ========================================
   Slide-in Panel (Power BI Viewer)
   ======================================== */
body.rdb-panel-open {
    overflow: hidden;
}

.rdb-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s linear 0.4s, opacity 0.4s ease;
}

.rdb-panel.is-active {
    visibility: visible;
    opacity: 1;
    transition: visibility 0s linear 0s, opacity 0.4s ease;
}

/* Overlay */
.rdb-panel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 35, 71, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.rdb-panel.is-active .rdb-panel-overlay {
    opacity: 1;
}

/* Panel Content */
.rdb-panel-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 88%;
    max-width: 1100px;
    background: #ffffff;
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.rdb-panel.is-active .rdb-panel-content {
    transform: translateX(0);
}

/* Panel Header */
.rdb-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--pucp-gradient);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.rdb-panel-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.4;
    padding-right: 1rem;
}

.rdb-panel-header-actions {
    display: flex;
    gap: 0.5rem;
}

.rdb-panel-fullscreen,
.rdb-panel-close {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 0.5rem;
    color: #ffffff;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.rdb-panel-fullscreen:hover,
.rdb-panel-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* Panel Body */
.rdb-panel-body {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #f8fafc;
}

.rdb-panel-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Loader */
.rdb-panel-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    z-index: 10;
}

.rdb-panel-loader p {
    margin-top: 1rem;
    color: var(--pucp-primary);
    font-size: 0.9375rem;
    font-weight: 500;
}

.rdb-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(0, 59, 113, 0.1);
    border-top-color: var(--pucp-accent);
    border-radius: 50%;
    animation: rdbSpin 1s linear infinite;
}

@keyframes rdbSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Animation Keyframes
   ======================================== */
@keyframes rdbFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Template Overrides
   ======================================== */
body.page-template-page-reportes-db #content.site-content {
    padding: 0 !important;
    margin: 0 !important;
}

body.page-template-page-reportes-db .entry-content {
    margin: 0;
    padding: 0;
}

body.page-template-page-reportes-db #main.site-main {
    padding: 0;
}

body.page-template-page-reportes-db .wp-block-group,
body.page-template-page-reportes-db .wp-block-columns,
body.page-template-page-reportes-db .wp-block-column {
    margin: 0;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1199.98px) {
    .rdb-layout {
        grid-template-columns: 240px 1fr;
    }

    .rdb-category-row {
        grid-template-columns: 130px 1fr;
    }

    .rdb-card {
        min-width: 130px;
        max-width: 180px;
    }
}

@media (max-width: 991.98px) {
    .rdb-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .rdb-sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .rdb-sidebar-inner {
        padding: 1.5rem;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 1rem;
    }

    .rdb-sidebar-title {
        margin: 0;
        padding: 0;
        border: none;
        font-size: 1.5rem;
        width: 100%;
    }

    .rdb-sidebar-body {
        flex: 1;
    }

    .rdb-sidebar-actions {
        flex-direction: row;
        margin-top: 0;
    }

    .rdb-category-row {
        grid-template-columns: 100px 1fr;
    }

    .rdb-category-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .rdb-panel-content {
        width: 92%;
    }
}

@media (max-width: 767.98px) {
    .rdb-dashboard {
        min-height: auto;
    }

    .rdb-sidebar-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .rdb-sidebar-actions {
        flex-direction: column;
        width: 100%;
    }

    .rdb-content {
        padding: 1rem;
        gap: 1.25rem;
    }

    .rdb-category-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .rdb-category-label {
        flex-direction: row;
        justify-content: flex-start;
        padding: 0.5rem 0;
        gap: 0.75rem;
    }

    .rdb-cards-row {
        gap: 0.5rem;
    }

    .rdb-card {
        min-width: 120px;
        max-width: none;
        flex: 1 1 calc(50% - 0.5rem);
    }

    .rdb-header-title {
        font-size: 0.875rem;
        letter-spacing: 0.5px;
    }

    .rdb-panel-content {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 575.98px) {
    .rdb-card {
        flex: 1 1 100%;
        max-width: 100%;
    }
}