/* stylesheet: admin_style.css */

:root {
    --bg-dark: #0A192F; /* Deep Navy from manual */
    --bg-card: rgba(16, 28, 50, 0.75);
    --border-color: rgba(0, 240, 255, 0.15); /* Cyan border */
    --primary: #00F0FF; /* Electric Cyan from manual */
    --primary-hover: #00D0DF;
    --text-white: #F8FAFC; /* Platinum White */
    --text-muted: #64748B; /* Steel Gray */
    --success: #10b981;
    --danger: #ef4444;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-title: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-dark);
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(0, 240, 255, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(100, 116, 139, 0.05) 0px, transparent 50%);
    color: var(--text-white);
    line-height: 1.6;
    padding-bottom: 2rem;
}

/* Header Navbar */
header {
    background: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-logo {
    height: 44px;
    width: auto;
    object-fit: contain;
}

.admin-brand {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-white);
}

.admin-brand span {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-badge {
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.25);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Container */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Welcome Banner */
.welcome-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.06) 0%, rgba(10, 25, 47, 0.8) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.welcome-banner h2 {
    font-family: var(--font-title);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 0.25rem;
}

.welcome-banner p {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-white);
}

.status-indicator .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-indicator .dot.active {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

/* Dashboard Grid (Adaptado al sistema de apilar columnas) */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    align-items: stretch;
}

/* Solo para Pantallas Grandes (Tablets y PC): Lo ponemos lado a lado */
@media (min-width: 1024px) {
    .dashboard-grid {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .dashboard-grid > .main-card {
        flex: 1.5;
        min-width: 0; /* Evita que el contenedor flex se desborde */
    }
    
    .dashboard-grid > div:not(.main-card) {
        flex: 0.85;
        min-width: 0;
    }
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid rgba(100, 116, 139, 0.12);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.main-card {
    border-color: var(--border-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(100, 116, 139, 0.15);
    padding-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-header h3 {
    font-family: var(--font-title);
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h3 i {
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-view-site {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.btn-view-site:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-save {
    background: var(--primary);
    color: var(--bg-dark);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.active-mode {
    background-color: var(--primary);
    color: var(--bg-dark) !important;
    font-weight: bold;
    border: 2px solid var(--primary);
}

.btn-save:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.45);
}

/* Table styling */
.products-table-container {
    overflow-x: auto;
    width: 100%;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.products-table th {
    padding: 1rem;
    border-bottom: 2px solid rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
}

.products-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(100, 116, 139, 0.1);
    vertical-align: middle;
}

.products-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

.table-img-container {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
}

.table-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #0f1025;
    border: 1px solid rgba(100, 116, 139, 0.15);
}

.img-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    cursor: pointer;
}

.table-img-container:hover .img-upload-overlay {
    opacity: 1;
}

.product-name-title {
    font-weight: 700;
    color: var(--text-white);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.product-name-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Price Input Cell (Larger & More Visible) */
.price-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(0, 240, 255, 0.25);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    min-width: 135px;
    max-width: 155px;
    transition: var(--transition);
}

.price-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
    background: rgba(0, 240, 255, 0.03);
}

.price-input-wrapper span {
    color: var(--primary);
    font-weight: 800;
    font-size: 1.15rem;
    margin-right: 0.35rem;
}

.price-input {
    background: none;
    border: none;
    color: var(--text-white);
    width: 100%;
    outline: none;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 800;
    text-align: right;
    letter-spacing: 0.5px;
}

.price-input::-webkit-outer-spin-button,
.price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Actions Styles */
.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: var(--danger);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.btn-delete:hover {
    background: var(--danger);
    color: var(--bg-dark);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
    transform: scale(1.05);
}

.btn-add-product {
    background: rgba(0, 240, 255, 0.08);
    border: 1.5px dashed var(--primary);
    color: var(--primary);
}

.btn-add-product:hover {
    background: var(--primary);
    color: var(--bg-dark);
    border-style: solid;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

/* Modal for Adding Products */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-dialog {
    background: #0f1c32;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.25rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: var(--transition);
}

.legal-text-scroll {
    max-height: 55vh;
    overflow-y: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 15px;
    padding-right: 10px;
}
.legal-text-scroll p {
    margin-bottom: 1rem;
}
.legal-text-scroll strong {
    color: var(--primary);
}
.legal-text-scroll::-webkit-scrollbar {
    width: 6px;
}
.legal-text-scroll::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
}
.legal-text-scroll::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.modal-overlay.open .modal-dialog {
    transform: scale(1);
}

.modal-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
    padding-bottom: 0.75rem;
}

.modal-title-row h3 {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-white);
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-close-modal:hover {
    color: var(--text-white);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-white);
}

.form-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-white);
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--primary);
    background: rgba(0, 240, 255, 0.02);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}


/* Switches & Toggles */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: .4s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-white);
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--success);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.stock-status-label {
    font-size: 0.8rem;
    font-weight: 700;
    vertical-align: middle;
}

/* Text Highlights */
.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

/* Category Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    display: inline-block;
}

.badge-category {
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.15);
    color: var(--primary);
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-card h3 {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(100, 116, 139, 0.15);
    padding-bottom: 0.5rem;
}

.sidebar-card h3 i {
    color: var(--primary);
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.help-card {
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(0, 240, 255, 0.02) 100%);
    border-left: 4px solid var(--primary);
}

.help-list {
    list-style: none;
    font-size: 0.84rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.help-list li {
    line-height: 1.5;
}

.help-list li i {
    color: var(--primary);
    margin-right: 0.25rem;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #10b981;
    color: white;
    padding: 1rem 1.75rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 0.95rem;
    transform: translateY(150px);
    transition: var(--transition);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
}

.toast i {
    font-size: 1.3rem;
}

/* Footer style */
footer {
    text-align: center;
    padding: 3rem 1.5rem 1rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    border-top: 1px solid rgba(100, 116, 139, 0.1);
    margin-top: 4rem;
}

footer p {
    margin-bottom: 0.5rem;
}

.signature {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.signature-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
}

.signature-link:hover {
    color: var(--text-white);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}
