/**
 * vrs-core.css - Core styles for vrs-core components
 *
 * CSS Custom Properties are set by Betreiber.get_css_variables():
 *   --v-primary: Primary brand color
 *   --v-secondary: Secondary brand color
 *   --v-font-family: Font family
 */

/* ================================
   CSS Custom Properties (Defaults)
   ================================ */
:root {
    --v-primary: #3b82f6;
    --v-secondary: #64748b;
    --v-font-family: 'Inter', sans-serif;
}

/* ================================
   Typography & Body
   ================================ */
html, body {
    height: 100%;
    font-family: var(--v-font-family), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ================================
   Navbar Theming
   ================================ */
.v-navbar {
    background-color: var(--v-primary) !important;
}

.v-navbar .navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.v-navbar .navbar-brand img {
    height: 36px;
}

.v-navbar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
}

.v-navbar .nav-link:hover {
    color: #ffffff !important;
}

.v-navbar .dropdown-toggle::after {
    margin-left: 0.5rem;
}

/* ================================
   Footer
   ================================ */
.v-footer {
    background-color: #f8f9fa;
    margin-top: auto;
}

.v-footer a {
    color: var(--v-primary);
    text-decoration: none;
}

.v-footer a:hover {
    text-decoration: underline;
}

/* ================================
   Admin Tiles
   ================================ */
.admin-tile {
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.admin-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.admin-tile .card-body {
    color: inherit;
}

/* ================================
   Module Header
   ================================ */
.module-header {
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* ================================
   Icon Picker
   ================================ */
#iconPickerOffcanvas {
    z-index: 1060 !important;
}

.icon-grid-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 4px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: white;
}

.icon-grid-item:hover {
    border-color: var(--v-primary);
    background-color: rgba(59, 130, 246, 0.1);
    transform: scale(1.1);
}

.icon-grid-item i {
    font-size: 1.5rem;
    color: #495057;
}

.icon-grid-item:hover i {
    color: var(--v-primary);
}

.icon-grid-item.selected {
    border-color: var(--v-primary);
    background-color: var(--v-primary);
}

.icon-grid-item.selected i {
    color: white;
}

#iconGrid {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

/* Icon spin animation */
.ti-spin {
    animation: ti-spin 1s linear infinite;
}

@keyframes ti-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ================================
   Markdown Editor
   ================================ */
.markdown-editor {
    position: relative;
}

.markdown-editor .markdown-preview {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.75rem;
    min-height: 120px;
    background: #fff;
    overflow: auto;
}

.markdown-editor .markdown-preview img {
    max-width: 100%;
    height: auto;
    cursor: pointer;
    border-radius: 0.25rem;
}

.markdown-editor .markdown-dropzone {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    border-radius: 0.375rem;
    z-index: 10;
    pointer-events: none;
}

/* ================================
   Help Modal
   ================================ */
.help-icon-btn:hover i {
    color: var(--bs-info) !important;
}

.help-content {
    font-size: 0.9rem;
    line-height: 1.6;
}

.help-content h1, .help-content h2, .help-content h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.help-content ul, .help-content ol {
    padding-left: 1.5rem;
}

.help-content code {
    background-color: #f1f5f9;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

.modal.help-modal {
    z-index: 1060 !important;
}

/* ================================
   Breadcrumb
   ================================ */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--v-primary);
}

.breadcrumb-item.active {
    color: var(--v-secondary);
}

/* ================================
   Tables
   ================================ */
.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* ================================
   Utilities
   ================================ */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
