/* Backoffice Global Styles */

/* Page Layout */
.backoffice-page {
    padding: 1.25rem;
    max-width: 1280px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #334155;
    margin: 0;
}

/* Modern Card Styles */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}

.card-header {
    background: #f8fafc;
    color: #334155;
    padding: 0.8rem 1rem;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
}

.card-body {
    padding: 1rem;
}

/* Modern Table Styles */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table thead {
    background: #f1f5f9;
    color: #475569;
}

.modern-table thead th {
    padding: 0.7rem 0.8rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.modern-table tbody tr {
    border-bottom: 1px solid #E8EAED;
    transition: all 0.2s;
}

.modern-table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
    transform: scale(1.01);
}

.modern-table tbody tr:last-child {
    border-bottom: none;
}

.modern-table tbody td {
    padding: 0.7rem 0.8rem;
    color: #2C3E50;
    font-weight: 500;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: none;
    transition: background-color 0.2s;
}

.badge:hover {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.badge-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.badge-success {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #f39c12 0%, #d68910 100%);
    color: white;
}

.badge-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.badge-secondary {
    background: linear-gradient(135deg, #95A5A6 0%, #7F8C8D 100%);
    color: white;
}

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 0.5rem 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn i, .btn span[class^="bi-"] {
    font-size: 1.1rem;
}

.btn-icon {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.btn-icon:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
    border-radius: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #95A5A6 0%, #7F8C8D 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #d68910 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn:active {
    transform: translateY(0);
}

/* Loading & No Data States */
.loading, .no-data {
    text-align: center;
    padding: 4rem 2rem;
    color: #7F8C8D;
    font-size: 1.2rem;
    font-weight: 500;
}

.loading::before {
    content: "? ";
    font-size: 2rem;
    display: block;
    margin-bottom: 1rem;
}

.no-data::before {
    content: "?? ";
    font-size: 2rem;
    display: block;
    margin-bottom: 1rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 700;
    color: #2C3E50;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.form-control {
    border-radius: 10px;
    border: 2px solid #E0E0E0;
    padding: 0.875rem 1.25rem;
    transition: all 0.3s;
    font-size: 1rem;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.15);
    outline: none;
}

.form-select {
    border-radius: 10px;
    border: 2px solid #E0E0E0;
    padding: 0.875rem 1.25rem;
    transition: all 0.3s;
    cursor: pointer;
}

.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.15);
    outline: none;
}

/* Alerts */
.alert {
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1) 0%, rgba(34, 153, 84, 0.1) 100%);
    color: #27ae60;
    border-left: 4px solid #27ae60;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(192, 57, 43, 0.1) 100%);
    color: #e74c3c;
    border-left: 4px solid #e74c3c;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.1) 0%, rgba(214, 137, 16, 0.1) 100%);
    color: #f39c12;
    border-left: 4px solid #f39c12;
}

.alert-info {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(41, 128, 185, 0.1) 100%);
    color: #3498db;
    border-left: 4px solid #3498db;
}

/* Responsive Design */
@media (max-width: 768px) {
    .backoffice-page {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-header h2 {
        font-size: 1.5rem;
    }

    .table-container {
        overflow-x: auto;
    }

    .modern-table {
        min-width: 600px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Image Cropper Styles */
.crop-container {
    position: relative;
    max-width: 100%;
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #E0E0E0;
}

.crop-container img {
    display: block;
    max-width: 100%;
    height: auto;
    user-select: none;
}

.crop-selection {
    position: absolute;
    cursor: move;
    border: 3px solid #667eea;
    box-shadow: 
        0 0 0 9999px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(102, 126, 234, 0.6),
        inset 0 0 20px rgba(102, 126, 234, 0.2);
    z-index: 10;
    box-sizing: border-box;
}

.crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border: 3px solid #667eea;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 11;
    cursor: nwse-resize;
    transition: all 0.2s;
}

.crop-handle:hover {
    transform: scale(1.3);
    background: #667eea;
}

.crop-nw {
    cursor: nw-resize;
}

.crop-ne {
    cursor: ne-resize;
}

.crop-sw {
    cursor: sw-resize;
}

.crop-se {
    cursor: se-resize;
}

.ratio-16x9 {
    aspect-ratio: 16/9;
}
