/* Custom styles for Badge Creator */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
}

/* Sidebar styles */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    background: linear-gradient(135deg, #667eea 0%, #684ba2 100%);
    color: white;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    border-radius: 0.375rem;
    margin: 0.25rem 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 16px;
    text-align: center;
}

/* Main content */
main {
    margin-left: 240px;
    padding-top: 20px;
}

@media (max-width: 767.98px) {
    .sidebar {
        position: relative;
        height: auto;
        padding: 1rem 0;
    }
    
    main {
        margin-left: 0;
    }
}

/* Modern Header Styles */
.modern-header {
    position: relative;
    padding: 0.5rem 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    margin-bottom: 1rem !important;
}

.title-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
}

.icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.icon-wrapper:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.icon-wrapper i {
    color: white;
    font-size: 0.875rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.title-content {
    flex: 1;
}

.modern-title {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.modern-subtitle {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0.15rem 0 0 0;
    font-weight: 400;
    opacity: 0.8;
}

/* Card enhancements */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

.card-header h5 {
    margin: 0;
    color: var(--dark-color);
}

.card-header i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

/* Form enhancements */
.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-control.is-valid {
    border-color: var(--success-color);
}

/* Button enhancements */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}



/* JSON Preview */
#json-preview {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.4;
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#json-preview code {
    color: #495057;
}

/* Badge card styles */
.badge-card {
    transition: transform 0.2s ease-in-out;
    cursor: pointer;
}

.badge-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.badge-preview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    border-radius: 0.375rem 0.375rem 0 0;
}

.badge-preview i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.badge-info {
    padding: 1.5rem;
}

.badge-meta {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-top: 0.5rem;
}

/* User Info Styles */
#user-info {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px !important;
    padding: 1rem !important;
    margin-top: 1.5rem !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

#user-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

#user-info .user-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

#user-info .user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    margin-right: 0.75rem;
}

#user-info .user-details {
    flex: 1;
    min-width: 0;
}

#user-info .user-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.875rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#user-info .user-role {
    font-size: 0.75rem;
    color: #718096;
    margin: 0;
    text-transform: capitalize;
}

#user-info .logout-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(238, 90, 82, 0.3);
}

#user-info .logout-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(238, 90, 82, 0.4);
    background: linear-gradient(135deg, #ff5252 0%, #e53e3e 100%);
}

#user-info .logout-btn:active {
    transform: scale(0.95);
}

/* Content sections */
.content-section {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sticky preview panel */
.sticky-top {
    top: 2rem;
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading::before {
    content: '\f110';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
    z-index: 11;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Alert enhancements */
.alert {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .sticky-top {
        position: relative !important;
        top: auto !important;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Validation feedback */
.invalid-feedback {
    display: block;
    font-size: 0.875rem;
    color: var(--danger-color);
    margin-top: 0.25rem;
}

.valid-feedback {
    display: block;
    font-size: 0.875rem;
    color: var(--success-color);
    margin-top: 0.25rem;
}

/* Badge status indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-valid {
    background-color: var(--success-color);
}

.status-invalid {
    background-color: var(--danger-color);
}

.status-pending {
    background-color: var(--warning-color);
}

/* Tooltip enhancements */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    background-color: var(--dark-color);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
}

/* Print styles */
@media print {
    .sidebar,
    .btn-toolbar,
    .card-header .btn {
        display: none !important;
    }
    
    main {
        margin-left: 0 !important;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* Estilos para el modal de galería de fondos */
#backgroundModal .modal-dialog {
    max-width: 900px;
    width: 90%;
}

#backgroundModal .modal-body {
    max-height: 600px;
    overflow-y: auto;
    padding: 1.5rem;
}

.gallery-image-item {
    position: relative;
    overflow: hidden;
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: white;
    padding: 0;
    margin-bottom: 1rem;
    cursor: pointer;
    height: 150px;
}

.gallery-image-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.gallery-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.375rem;
    display: block;
}

.gallery-image-item:hover img {
    transform: scale(1.05);
}

#gallery-grid {
    max-height: 400px;
    overflow-y: auto;
    width: 100%;
}

#gallery-grid .col-xl-2,
#gallery-grid .col-lg-3,
#gallery-grid .col-md-4,
#gallery-grid .col-sm-6,
#gallery-grid .col-6 {
    padding: 0.5rem;
    flex: 0 0 auto;
}

#gallery-loading {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#gallery-error {
    margin: 1rem 0;
}

/* Scrollbar personalizado para la galería */
#gallery-grid::-webkit-scrollbar {
    width: 8px;
}

#gallery-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#gallery-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#gallery-grid::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive para dispositivos móviles */
@media (max-width: 768px) {
    #backgroundModal .modal-dialog {
        max-width: 95%;
        margin: 1rem auto;
    }
    
    .gallery-image-item img {
        height: 100px;
    }
    
    #gallery-grid {
        max-height: 300px;
    }
}