/* ============================================================================
   ENHANCED STYLES - Kwatermistrz 2.0
   Dodaj te style do assets/css/styles.css
   ============================================================================ */

/* ============================================================================
   CSS VARIABLES (CUSTOM PROPERTIES)
   ============================================================================ */

:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --primary-darker: #004085;
    --success-color: #28a745;
    --success-dark: #1e7e34;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #2c3e50;
    --gray-color: #6c757d;
    --border-color: #e9ecef;
    --shadow-color: rgba(0,0,0,0.1);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --border-radius: 12px;
    --border-radius-lg: 15px;
    --border-radius-xl: 20px;
}

/* ============================================================================
   ENHANCED PHOTO GALLERY STYLES
   ============================================================================ */

.photo-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.photo-thumbnail-enhanced {
    position: relative;
    cursor: pointer;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all var(--transition-normal);
    background: var(--light-color);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.photo-thumbnail-enhanced:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.photo-thumbnail-enhanced img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.photo-overlay-enhanced {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 15px;
    font-size: 12px;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.photo-thumbnail-enhanced:hover .photo-overlay-enhanced {
    opacity: 1;
}

.photo-filename {
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-meta {
    opacity: 0.9;
    font-size: 11px;
}

/* Photo Modal Styles */
.photo-modal-enhanced .modal-content {
    background: #000;
    border: none;
}

.photo-viewer-enhanced {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    user-select: none;
}

.photo-main {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    transition: transform var(--transition-normal);
    cursor: zoom-in;
}

.photo-main.zoomed {
    cursor: grab;
    transform: scale(2);
}

.photo-main.zoomed:active {
    cursor: grabbing;
}

.photo-loading-enhanced {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1051;
}

.photo-close-enhanced,
.photo-nav-enhanced {
    position: fixed;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1052;
    transition: all var(--transition-fast);
    backdrop-filter: blur(10px);
}

.photo-close-enhanced {
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 20px;
}

.photo-nav-enhanced {
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    font-size: 24px;
}

.photo-close-enhanced:hover,
.photo-nav-enhanced:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    transform: scale(1.1);
}

.photo-nav-enhanced:hover {
    transform: translateY(-50%) scale(1.1);
}

.photo-nav-enhanced.prev {
    left: 30px;
}

.photo-nav-enhanced.next {
    right: 30px;
}

.photo-nav-enhanced:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.photo-info-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1051;
    backdrop-filter: blur(10px);
    transition: transform var(--transition-normal);
}

.photo-info-panel.hidden {
    transform: translateY(100%);
}

.photo-counter-enhanced {
    font-size: 18px;
    font-weight: 600;
    color: var(--warning-color);
}

.photo-filename-large {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 16px;
}

.photo-metadata div {
    margin-bottom: 4px;
    font-size: 14px;
    opacity: 0.9;
}

.photo-metadata i {
    width: 16px;
    text-align: center;
    margin-right: 8px;
    color: var(--warning-color);
}

.photo-actions {
    display: flex;
    gap: 10px;
}

.photo-actions .btn {
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(5px);
}

.photo-actions .btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

/* ============================================================================
   ENHANCED TIMELINE STYLES
   ============================================================================ */

.timeline-enhanced {
    position: relative;
    padding-left: 35px;
}

.timeline-enhanced::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-color), var(--gray-color));
    border-radius: 2px;
}

.timeline-item-enhanced {
    position: relative;
    margin-bottom: 25px;
}

.timeline-marker-enhanced {
    position: absolute;
    left: -23px;
    top: 5px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    border: 3px solid white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    z-index: 1;
}

.timeline-content-enhanced {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-left: 15px;
    border-left: 4px solid var(--primary-color);
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all var(--transition-fast);
}

.timeline-content-enhanced:hover {
    box-shadow: 0 4px 20px var(--shadow-color);
    transform: translateY(-2px);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.timeline-header h6 {
    margin: 0;
    color: var(--dark-color);
    font-weight: 600;
}

.timeline-body {
    color: #495057;
}

.change-detail {
    padding: 8px 12px;
    background: rgba(0,123,255,0.1);
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    margin: 8px 0;
}

.change-detail small {
    color: #495057;
}

.change-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.change-old,
.change-new {
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
}

.change-old {
    background: rgba(220,53,69,0.1);
    border-left: 3px solid var(--danger-color);
}

.change-new {
    background: rgba(40,167,69,0.1);
    border-left: 3px solid var(--success-color);
}

/* ============================================================================
   ENHANCED TABLE STYLES
   ============================================================================ */

.table-enhanced {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.table-enhanced thead th {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-weight: 600;
    border: none;
    padding: 15px 12px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-enhanced thead th a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-enhanced thead th a:hover {
    color: var(--warning-color);
}

.table-enhanced tbody tr {
    transition: all var(--transition-fast);
    border: none;
}

.table-enhanced tbody tr:hover {
    background: var(--light-color);
    transform: scale(1.01);
    box-shadow: 0 2px 10px var(--shadow-color);
}

.table-enhanced tbody td {
    padding: 15px 12px;
    border-top: 1px solid var(--border-color);
    vertical-align: middle;
}

.table-enhanced .badge {
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 20px;
    font-weight: 500;
}

/* Avatar Styles */
.avatar-sm {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-details .fw-bold {
    color: var(--dark-color);
    font-size: 14px;
}

.user-details .text-muted {
    font-size: 12px;
}

/* ============================================================================
   ENHANCED CARD STYLES
   ============================================================================ */

.card-enhanced {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.card-enhanced:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.card-enhanced .card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 20px;
    font-weight: 600;
}

.card-enhanced .card-header i {
    margin-right: 10px;
    color: var(--warning-color);
}

.card-enhanced .card-body {
    padding: 25px;
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, #fff, var(--light-color));
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    text-align: center;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color), var(--warning-color), var(--danger-color));
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--shadow-color);
}

.stats-card h5 {
    margin-bottom: 15px;
    color: var(--dark-color);
    font-weight: 600;
}

.stats-card .badge {
    font-size: 18px;
    padding: 10px 15px;
    border-radius: 25px;
}

/* ============================================================================
   ENHANCED FILTER STYLES
   ============================================================================ */

.filters-card {
    background: linear-gradient(135deg, var(--light-color), #e9ecef);
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.filters-card .card-header {
    background: transparent;
    border-bottom: 2px solid #dee2e6;
    color: var(--dark-color);
    font-weight: 600;
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.form-select,
.form-control {
    border-radius: 10px;
    border: 2px solid var(--border-color);
    transition: all var(--transition-fast);
}

.form-select:focus,
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* ============================================================================
   ENHANCED BUTTON STYLES
   ============================================================================ */

.btn-enhanced {
    border-radius: 10px;
    font-weight: 600;
    padding: 12px 24px;
    transition: all var(--transition-fast);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-enhanced:hover::before {
    left: 100%;
}

.btn-primary-enhanced {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary-enhanced:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-darker));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,123,255,0.4);
}

.btn-success-enhanced {
    background: linear-gradient(135deg, var(--success-color), var(--success-dark));
    color: white;
}

.btn-success-enhanced:hover {
    background: linear-gradient(135deg, var(--success-dark), #155724);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40,167,69,0.4);
}

/* ============================================================================
   ENHANCED LOADING STATES
   ============================================================================ */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius-lg);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* ============================================================================
   ENHANCED ANIMATIONS
   ============================================================================ */

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-slide-up {
    animation: slideInUp 0.3s ease-out;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

/* ============================================================================
   ENHANCED UTILITIES
   ============================================================================ */

.glass-effect {
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.18);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.shadow-soft {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.shadow-medium {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.shadow-strong {
    box-shadow: 0 15px 35px rgba(0,0,0,0.1), 0 5px 15px rgba(0,0,0,0.07);
}

.border-radius-lg {
    border-radius: var(--border-radius-lg);
}

.border-radius-xl {
    border-radius: var(--border-radius-xl);
}

/* ============================================================================
   RESPONSIVE MOBILE STYLES
   ============================================================================ */

@media (max-width: 768px) {
    /* Photo Gallery Mobile */
    .photo-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .photo-thumbnail-enhanced img {
        height: 120px;
    }
    
    .photo-nav-enhanced {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .photo-nav-enhanced.prev {
        left: 15px;
    }
    
    .photo-nav-enhanced.next {
        right: 15px;
    }
    
    .photo-close-enhanced {
        width: 40px;
        height: 40px;
        font-size: 16px;
        top: 15px;
        right: 15px;
    }
    
    .photo-info-panel {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 15px;
    }
    
    .photo-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* Timeline Mobile */
    .timeline-enhanced {
        padding-left: 25px;
    }
    
    .timeline-enhanced::before {
        left: 10px;
    }
    
    .timeline-marker-enhanced {
        left: -13px;
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    .timeline-content-enhanced {
        margin-left: 10px;
        padding: 15px;
    }
    
    /* Table Mobile */
    .table-responsive {
        border-radius: var(--border-radius);
        overflow: hidden;
    }
    
    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    /* Cards Mobile */
    .stats-card {
        margin-bottom: 15px;
    }
    
    .filters-card .row {
        --bs-gutter-x: 1rem;
    }
    
    /* Buttons Mobile */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: 8px !important;
        margin-bottom: 5px;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    .photo-modal-enhanced,
    .btn,
    .navbar,
    .timeline-marker-enhanced {
        display: none !important;
    }
    
    .timeline-content-enhanced {
        border: 1px solid #000;
        margin-bottom: 15px;
    }
    
    .table-enhanced {
        box-shadow: none;
    }
    
    /* Zachowaj ważne kolory w druku */
    .card-enhanced .card-header {
        background: #000 !important;
        color: #fff !important;
    }
}