/*
Theme Name: Škola na dlanu 2.0
Theme URI: https://školanadlanu.hr
Description: A custom WordPress theme for managing school mini-apps and data
Author: Nikola Vujačić
Version: 2.0
Text Domain: školanadlanu.hr
*/

/* ========================================
   CSS Varijable - Moderna SaaS Paleta
   ======================================== */
:root {
    --color-sidebar: #1e293b;
    --color-sidebar-dark: #0f172a;
    --color-bg: #f8fafc;
    --color-card: #ffffff;
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-text: #1e293b;
    --color-text-light: #64748b;
    --color-text-sidebar: #e2e8f0;
    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --radius-lg: 12px;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sticky footer layout */
.site {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.site-main {
    flex: 1;
}

/* ========================================
   Top Header
   ======================================== */
.top-header {
    background-color: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.back-button {
    background: none;
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.back-button:hover {
    background-color: var(--color-bg);
    color: var(--color-primary);
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    flex: 1;
    text-align: center;
}

.header-spacer {
    width: 40px; /* Balansiranje za back button */
}

/* ========================================
   Main Container - Grid Layout
   ======================================== */
.main-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    flex: 1;
    overflow: hidden;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    background-color: var(--color-sidebar);
    color: var(--color-text-sidebar);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.sidebar-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
    margin-bottom: 1rem;
    color: #94a3b8;
}

/* Filter Groups */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #cbd5e1;
}

.filter-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--color-text-sidebar);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background-color: rgba(255, 255, 255, 0.1);
}

.filter-select option {
    background-color: var(--color-sidebar-dark);
    color: var(--color-text-sidebar);
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-text-sidebar);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-text-sidebar);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Divider */
.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 0.5rem 0;
}

/* Actions Section */
.actions-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Clock Widget */
.clock-widget {
    margin-top: auto;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(99, 102, 241, 0.05));
    border-radius: var(--radius-lg);
    border: 1px solid rgba(79, 70, 229, 0.2);
    text-align: center;
}

.clock-time {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-text-sidebar);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.clock-status {
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.4;
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    padding: 2rem;
    overflow-y: auto;
    background-color: var(--color-bg);
}

.schedule-card {
    background-color: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--color-border-light);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.card-body {
    padding: 0;
}

.table-container {
    overflow-x: auto;
}

/* ========================================
   Schedule Table
   ======================================== */
.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.schedule-table thead {
    background-color: #f8fafc;
    border-bottom: 2px solid var(--color-border);
}

.schedule-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--color-text);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.schedule-table tbody tr {
    border-bottom: 1px solid var(--color-border-light);
    transition: background-color 0.2s;
}

.schedule-table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.schedule-table tbody tr:hover {
    background-color: #f1f5f9;
}

.schedule-table td {
    padding: 1rem 1.5rem;
    color: var(--color-text);
}

/* Day Separator for Weekly View */
.day-separator {
    background-color: transparent !important;
}

.day-separator:hover {
    background-color: transparent !important;
}

.day-header {
    padding: 1.5rem 1.5rem 0.75rem !important;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--color-primary) !important;
    background: linear-gradient(to right, rgba(79, 70, 229, 0.05), transparent) !important;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem !important;
    background-color: transparent !important;
}

.empty-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--color-text-light);
}

.empty-content svg {
    opacity: 0.3;
}

.empty-content p {
    font-size: 1rem;
    color: var(--color-text-light);
}

/* ========================================
   Modal
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--color-text-light);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.modal-close:hover {
    background-color: var(--color-bg);
    color: var(--color-text);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.free-room-item {
    padding: 0.75rem 1rem;
    background-color: var(--color-bg);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 280px 1fr;
    }
}

@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none; /* Za mobile, može se dodati toggle dugme */
    }

    .main-content {
        padding: 1rem;
    }

    .schedule-table {
        font-size: 0.75rem;
    }

    .schedule-table th,
    .schedule-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    body {
        background-color: white;
    }

    .top-header,
    .sidebar,
    .btn,
    .back-button,
    .modal {
        display: none !important;
    }

    .main-container {
        display: block;
    }

    .main-content {
        padding: 0;
        overflow: visible;
    }

    .schedule-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .schedule-table {
        page-break-inside: auto;
    }

    .schedule-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    .schedule-table thead {
        display: table-header-group;
    }

    .schedule-table tbody tr:nth-child(even) {
        background-color: #f9f9f9 !important;
    }

    .schedule-table tbody tr:hover {
        background-color: inherit !important;
    }
    
    .day-header {
        background: #f0f0f0 !important;
        page-break-after: avoid;
    }
    
    .day-separator + tr {
        page-break-before: avoid;
    }
}

/* ========================================
   Scrollbar Styling
   ======================================== */
.sidebar::-webkit-scrollbar,
.main-content::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.main-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
