/* DrugAI Analyzer - Custom Styles */

/* ========================================
   LOADING OVERLAY - ANALISI AI
   ======================================== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.loading-overlay.active {
    display: flex !important;
}

.loading-content {
    text-align: center;
    color: white;
    background: linear-gradient(135deg, #1a1d29 0%, #2d3142 100%);
    padding: 3rem 2.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.1);
    min-width: 350px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-spinner {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 2rem;
    border: 0.5rem solid rgba(255, 255, 255, 0.2);
    border-top-color: #0d6efd;
    border-right-color: #0d6efd;
    border-radius: 50%;
    animation: spinner 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes spinner {
    to { 
        transform: rotate(360deg); 
    }
}

.loading-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.loading-details {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.loading-progress {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin-top: 1.5rem;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0d6efd, #0dcaf0);
    border-radius: 2px;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* ========================================
   GENERAL STYLES
   ======================================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-header {
    font-weight: 600;
    border-bottom: 2px solid rgba(0, 0, 0, 0.125);
    background-color: rgba(0, 0, 0, 0.03);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s;
}

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

/* ========================================
   FORMS
   ======================================== */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    transition: border-color 0.15s, box-shadow 0.15s;
}

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

/* ========================================
   TABLES
   ======================================== */
.table {
    margin-bottom: 0;
}

.table-hover tbody tr {
    transition: background-color 0.15s;
    cursor: pointer;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* ========================================
   DASHBOARD
   ======================================== */
.dashboard-card {
    transition: transform 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

/* ========================================
   ALERTS & BADGES
   ======================================== */
.alert {
    border-radius: 0.5rem;
    border-left: 4px solid;
}

.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* ========================================
   LOGIN PAGE
   ======================================== */
.login-card {
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
}

.theme-toggle-login {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-toggle-login:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ========================================
   DARK MODE
   ======================================== */
[data-bs-theme="dark"] body {
    background-color: #212529;
    color: #dee2e6;
}

[data-bs-theme="dark"] .navbar {
    background-color: #343a40 !important;
}

[data-bs-theme="dark"] .card {
    background-color: #2b3035;
    color: #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .card-header {
    background-color: #343a40;
    color: #dee2e6;
    border-bottom: 2px solid #495057;
}

[data-bs-theme="dark"] .table {
    color: #dee2e6;
}

[data-bs-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.075);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #343a40;
    border-color: #495057;
    color: #dee2e6;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #343a40;
    border-color: #86b7fe;
    color: #dee2e6;
}

[data-bs-theme="dark"] footer {
    background-color: #343a40;
    color: #adb5bd;
}

[data-bs-theme="dark"] .theme-toggle-login {
    background-color: #343a40;
    border-color: #495057;
    color: #ffc107;
}

[data-bs-theme="dark"] .loading-content {
    background: linear-gradient(135deg, #0a0c10 0%, #1a1d29 100%);
    border-color: rgba(255, 255, 255, 0.15);
}

/* ========================================
   SCROLLBAR CUSTOM
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

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

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: #343a40;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #6c757d;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .loading-content {
        min-width: 90%;
        padding: 2rem 1.5rem;
    }
    
    .loading-text {
        font-size: 1.2rem;
    }
    
    .loading-spinner {
        width: 4rem;
        height: 4rem;
    }
}

/* ========================================
   UTILITIES
   ======================================== */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.box-shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.box-shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}
