/**
 * Modern CSS for Panel Wyspawane.pl
 * Premium Glass Design - Menu RIGHT, Content LEFT
 */

/* ============================================
   CSS Variables & Root Configuration
   ============================================ */
:root {
    /* Color Palette - Premium Gradient */
    --color-primary: #6366f1;
    --color-primary-dark: #4f46e5;
    --color-primary-light: #818cf8;
    --color-secondary: #64748b;
    --color-accent: #f472b6;
    --color-accent-2: #22d3ee;
    
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #0ea5e9;
    
    /* Backgrounds - Glass Effect */
    --color-background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --color-surface: rgba(255, 255, 255, 0.85);
    --color-surface-glass: rgba(255, 255, 255, 0.15);
    --color-border: rgba(100, 116, 139, 0.5);
    --color-border-solid: rgba(71, 85, 105, 0.7);
    
    /* Text */
    --color-text: #1e293b;
    --color-text-light: #64748b;
    --color-text-muted: #94a3b8;
    --color-text-white: #ffffff;
    
    /* Shadows - Premium */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.25);
    --shadow-glass: 0 8px 32px rgba(31, 38, 135, 0.15);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --container-max-width: 1600px;
    --header-height: 70px;
    --sidebar-width: 280px;
    --footer-height: 60px;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--color-background);
    background-attachment: fixed;
    color: var(--color-text);
    min-height: 100vh;
}

/* ============================================
   App Container - Glass Layout
   ============================================ */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Header - Glass Style
   ============================================ */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border-solid);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
}

.header-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-xl);
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.logo-img {
    height: 45px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.user-badge svg {
    opacity: 0.9;
}

/* ============================================
   Main Layout - Content LEFT, Menu RIGHT
   ============================================ */
.main-wrapper {
    flex: 1;
    max-width: var(--container-max-width);
    width: 100%;
    margin: 0 auto;
    padding: var(--space-xl);
    display: flex;
    gap: var(--space-xl);
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

/* Main Content - LEFT Side */
.main-content {
    flex: 1;
    order: 1; /* Content on LEFT */
    min-width: 0;
}

.content-card {
    background: var(--color-surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--color-border-solid);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-glass);
    min-height: 100%;
}

/* Sidebar - RIGHT Side */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    order: 2; /* Menu on RIGHT */
}

/* ============================================
   Sidebar Navigation - Glass Cards
   ============================================ */
.links {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Menu Section Toggle */
.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--color-surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border-solid);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.menu-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-light);
    background: rgba(255, 255, 255, 0.95);
}

.menu-toggle.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

.menu-toggle::after {
    content: '▼';
    font-size: 0.7rem;
    transition: transform var(--transition-base);
    opacity: 0.7;
}

.menu-toggle.active::after {
    transform: rotate(180deg);
    opacity: 1;
}

/* Menu Group - Links Container */
.link-group {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow), opacity var(--transition-base);
    opacity: 0;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    margin-top: -8px;
    padding-top: 8px;
}

.link-group.open {
    max-height: 500px;
    opacity: 1;
    border: 1px solid var(--color-border-solid);
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.link-group a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.link-group a:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    padding-left: calc(var(--space-lg) + 4px);
}

.link-group a:last-child {
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* Standalone Menu Links */
.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--color-surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border-solid);
    border-radius: var(--radius-lg);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.sidebar-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-light);
}

.sidebar-link.logout {
    background: linear-gradient(135deg, var(--color-error) 0%, #dc2626 100%);
    color: white;
    border-color: transparent;
}

.sidebar-link.logout:hover {
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

/* ============================================
   Content Cards & Components
   ============================================ */
.top, .top1 {
    background: var(--color-surface);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-solid);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.top:hover, .top1:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.top1 {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: rgba(99, 102, 241, 0.2);
}

.font_titel, .font_titel_2 {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-md);
}

.font_titel {
    font-size: 1.125rem;
}

.font_titel_2 {
    font-size: 1.75rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Tables - Modern Glass
   ============================================ */
.tabelka {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-solid);
}

.tabelka th {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    font-weight: 600;
    color: var(--color-primary-dark);
    border-bottom: 2px solid var(--color-border-solid);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tabelka td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    vertical-align: middle;
}

.tabelka tr:last-child td {
    border-bottom: none;
}

.tabelka tbody tr {
    transition: all var(--transition-fast);
}

.tabelka tbody tr:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.03) 100%);
}

/* ============================================
   Forms & Inputs - Premium Style
   ============================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: var(--space-md);
    border: 2px solid var(--color-border-solid);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-base);
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-text);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), var(--shadow-sm);
    background: white;
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.9rem;
}

/* ============================================
   Buttons - Gradient & Glass
   ============================================ */
.button_input,
button,
.btn {
    padding: var(--space-md) var(--space-xl);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

button:hover,
.btn:hover,
.button_input:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow), var(--shadow-md);
    filter: brightness(1.05);
}

button:active,
.btn:active,
.button_input:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--color-secondary) 0%, #475569 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success) 0%, #16a34a 100%);
}

.btn-warning {
    background: linear-gradient(135deg, var(--color-warning) 0%, #d97706 100%);
}

.btn-error, .btn-danger {
    background: linear-gradient(135deg, var(--color-error) 0%, #dc2626 100%);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: white;
}

.btn-glass {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

/* ============================================
   Alerts & Messages
   ============================================ */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    backdrop-filter: blur(10px);
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--color-success);
    color: #166534;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--color-error);
    color: #991b1b;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--color-warning);
    color: #92400e;
}

.alert-info {
    background: rgba(14, 165, 233, 0.15);
    border-color: var(--color-info);
    color: #0369a1;
}

/* ============================================
   Footer - Glass
   ============================================ */
.footer {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--color-border-solid);
    padding: var(--space-lg) var(--space-xl);
    text-align: center;
    height: var(--footer-height);
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer p {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .main-wrapper {
        flex-direction: column;
        padding: var(--space-lg);
    }
    
    .sidebar {
        width: 100%;
        order: 1; /* Menu on top on mobile */
    }
    
    .main-content {
        order: 2;
    }
    
    .links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-sm);
    }
    
    .menu-toggle {
        flex: 1 1 auto;
        min-width: 150px;
    }
    
    .link-group {
        position: absolute;
        width: calc(100% - 2rem);
        z-index: 50;
        margin-top: 0;
        padding-top: 0;
    }
    
    .link-group.open {
        border-top: 1px solid var(--color-border-solid);
        border-radius: var(--radius-lg);
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
        --space-xl: 1.25rem;
    }
    
    .header-content {
        padding: 0 var(--space-md);
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
    
    .content-card {
        padding: var(--space-md);
    }
    
    .font_titel_2 {
        font-size: 1.5rem;
    }
    
    .tabelka th,
    .tabelka td {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.875rem;
    }
    
    .user-badge span:not(:first-child) {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 var(--space-sm);
    }
    
    .logo-img {
        height: 35px;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    button,
    .btn {
        width: 100%;
    }
    
    .menu-toggle {
        min-width: 100%;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-warning { color: var(--color-warning); }
.text-muted { color: var(--color-text-muted); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-glow { box-shadow: var(--shadow-glow); }

.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }

/* Animation Utilities */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card Hover Effect */
.card-hover {
    transition: all var(--transition-base);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
