/**
 * VarioStack - Theme CSS
 * Standardized spacing, colors, and component styles
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    /* Spacing */
    --akua-page-padding: 1.5rem;
    --akua-section-margin: 1.5rem;
    --akua-card-margin: 1rem;
    --akua-element-spacing: 1rem;

    /* Colors - Bootstrap compatible */
    --akua-primary: #0d6efd;
    --akua-secondary: #6c757d;
    --akua-success: #198754;
    --akua-danger: #dc3545;
    --akua-warning: #ffc107;
    --akua-info: #0dcaf0;

    /* Borders */
    --akua-border-radius: 0.375rem;
    --akua-border-color: #dee2e6;
}

/* ========================================
   Page Layout
   ======================================== */
.akua-page-container {
    padding: var(--akua-page-padding);
}

.akua-page-header {
    margin-bottom: var(--akua-section-margin);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.akua-page-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 500;
}

/* ========================================
   Card Components
   ======================================== */
.akua-card {
    margin-bottom: var(--akua-card-margin);
    border: 1px solid var(--akua-border-color);
    border-radius: var(--akua-border-radius);
    background-color: #fff;
}

.akua-card-header {
    padding: 0.75rem 1.25rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--akua-border-color);
    border-radius: calc(var(--akua-border-radius) - 1px) calc(var(--akua-border-radius) - 1px) 0 0;
}

.akua-card-body {
    padding: 1.25rem;
}

.akua-card-footer {
    padding: 0.75rem 1.25rem;
    background-color: #f8f9fa;
    border-top: 1px solid var(--akua-border-color);
    border-radius: 0 0 calc(var(--akua-border-radius) - 1px) calc(var(--akua-border-radius) - 1px);
}

/* ========================================
   Table Components
   ======================================== */
.akua-table-card {
    margin-bottom: var(--akua-card-margin);
}

.akua-table-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.akua-table-card .table {
    margin-bottom: 0;
}

.akua-table-card .table thead th {
    border-top: none;
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
}

.akua-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ========================================
   Detail Layout
   ======================================== */
.akua-detail-layout {
    display: flex;
    gap: var(--akua-element-spacing);
}

.akua-detail-main {
    flex: 1;
    min-width: 0;
    /* Prevent flex item from overflowing */
}

.akua-detail-sidebar {
    flex: 0 0 auto;
    width: 100%;
    max-width: 350px;
}

@media (max-width: 768px) {
    .akua-detail-layout {
        flex-direction: column;
    }

    .akua-detail-sidebar {
        max-width: 100%;
    }
}

.akua-detail-card {
    margin-bottom: var(--akua-card-margin);
}

.akua-detail-card dl {
    margin-bottom: 0;
}

.akua-detail-card dt {
    font-weight: 600;
    color: #495057;
}

.akua-detail-card dd {
    margin-bottom: 0.5rem;
    color: #212529;
}

/* ========================================
   Form Components
   ======================================== */
.akua-form-layout {
    display: flex;
    gap: var(--akua-element-spacing);
}

.akua-form-main {
    flex: 1;
    min-width: 0;
}

.akua-form-sidebar {
    flex: 0 0 auto;
    width: 100%;
    max-width: 300px;
}

@media (max-width: 768px) {
    .akua-form-layout {
        flex-direction: column;
    }

    .akua-form-sidebar {
        max-width: 100%;
    }
}

.akua-form-card {
    margin-bottom: var(--akua-card-margin);
}

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

/* ========================================
   Empty State
   ======================================== */
.akua-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #6c757d;
}

.akua-empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.akua-empty-state-message {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.akua-empty-state-action {
    margin-top: 1rem;
}

/* ========================================
   Action Buttons
   ======================================== */
.akua-action-buttons {
    display: inline-flex;
    gap: 0.25rem;
}

.akua-action-buttons .btn {
    border-radius: var(--akua-border-radius);
}

/* Ensure consistent button sizing */
.akua-action-buttons .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* ========================================
   Pagination
   ======================================== */
.akua-pagination {
    margin-top: var(--akua-element-spacing);
    display: flex;
    justify-content: center;
}

.akua-pagination .pagination {
    margin-bottom: 0;
}

/* ========================================
   Badges
   ======================================== */
.akua-badge {
    padding: 0.35em 0.65em;
    font-size: 0.875em;
    font-weight: 500;
    border-radius: 0.25rem;
}

/* Status-specific badge colors */
.akua-badge-online,
.akua-badge-active,
.akua-badge-connected,
.akua-badge-success {
    background-color: var(--akua-success);
    color: white;
}

.akua-badge-offline,
.akua-badge-inactive,
.akua-badge-disconnected,
.akua-badge-unassigned,
.akua-badge-disabled {
    background-color: var(--akua-secondary);
    color: white;
}

.akua-badge-warning,
.akua-badge-pending {
    background-color: var(--akua-warning);
    color: #000;
}

.akua-badge-danger,
.akua-badge-error,
.akua-badge-failed,
.akua-badge-blacklisted {
    background-color: var(--akua-danger);
    color: white;
}

.akua-badge-info {
    background-color: var(--akua-info);
    color: #000;
}

/* ========================================
   Modals
   ======================================== */
.akua-modal-danger .modal-header {
    background-color: #dc3545;
    color: white;
}

.akua-modal-warning .modal-header {
    background-color: #ffc107;
    color: #000;
}

.akua-modal-info .modal-header {
    background-color: #0dcaf0;
    color: #000;
}

/* ========================================
   Utility Classes
   ======================================== */
.akua-mb-section {
    margin-bottom: var(--akua-section-margin);
}

.akua-mb-card {
    margin-bottom: var(--akua-card-margin);
}

.akua-mb-element {
    margin-bottom: var(--akua-element-spacing);
}

/* Text utilities */
.akua-text-muted {
    color: #6c757d;
}

.akua-text-small {
    font-size: 0.875rem;
}

/* Responsive utilities */
@media (max-width: 576px) {
    .akua-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .akua-page-title {
        font-size: 1.5rem;
    }
}

/* ========================================
   Chart Components
   ======================================== */
.akua-chart-container {
    height: 400px;
}

.akua-max-h-300 {
    max-height: 300px;
}

.akua-h-4 {
    height: 4px;
}

.akua-max-h-70vh {
    max-height: 70vh;
}

.akua-overflow-y-auto {
    overflow-y: auto;
}

.akua-max-w-300 {
    max-width: 300px;
}

.akua-overflow-hidden {
    overflow: hidden;
}

.akua-max-h-200 {
    max-height: 200px;
}

.akua-max-h-150 {
    max-height: 150px;
}

.akua-h-25 {
    height: 25px;
}

.akua-pt-navbar {
    padding-top: 56px;
}

.akua-w-38 {
    width: 38px;
}

.akua-h-38 {
    height: 38px;
}

.akua-h-300 {
    height: 300px;
}

.akua-fs-2rem {
    font-size: 2rem;
}

/* ========================================
   Marketing Homepage Styles
   ======================================== */

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 500px;
    display: flex;
    align-items: center;
}

.hero-illustration {
    text-align: center;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Feature Cards */
.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .15) !important;
}

.feature-icon i {
    font-size: 3rem;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 300px;
    display: flex;
    align-items: center;
}

.cta-section .btn-light {
    font-weight: 600;
    padding: 0.75rem 2rem;
    transition: transform 0.2s ease;
}

.cta-section .btn-light:hover {
    transform: scale(1.05);
}

/* Step Numbers */
.step-number .badge {
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* ========================================
   Sidebar & Admin Layout
   ======================================== */

body {
    overflow-x: hidden;
}

.sidebar {
    width: 240px;
    transition: transform 0.3s ease-in-out;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.main-content {
    transition: margin-left 0.3s ease-in-out;
    margin-left: 240px;
    width: calc(100% - 240px);
}

.sidebar.collapsed+.main-content {
    margin-left: 0;
    width: 100%;
}

/* Sidebar collapsible menu styles */
.sidebar .nav-link {
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link[data-bs-toggle="collapse"] {
    cursor: pointer;
}

.sidebar .nav-link[data-bs-toggle="collapse"] .bi-chevron-down {
    transition: transform 0.3s;
}

.sidebar .nav-link[data-bs-toggle="collapse"][aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.sidebar .collapse,
.sidebar .collapsing {
    padding-left: 0;
}

.sidebar .collapse ul,
.sidebar .collapsing ul {
    margin-bottom: 0;
}

.sidebar .collapse .nav-link,
.sidebar .collapsing .nav-link {
    padding: 0.45rem 1rem 0.45rem 2.25rem;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.sidebar .collapse .nav-link:hover,
.sidebar .collapsing .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.collapsed {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* Breadcrumb styling for dark navbar */
.navbar .breadcrumb {
    background-color: transparent;
    padding: 0;
    margin: 0;
}

.navbar .breadcrumb-item {
    color: rgba(255, 255, 255, 0.75);
}

.navbar .breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.9);
}

.navbar .breadcrumb-item+.breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.5);
    content: ">";
}
