:root {
    --bg-color: #F9F7F2; /* Off-White */
    --wall-color: #eaddd3;
    --text-color: #1a1a1a;
    --accent-color: #D4AF37; /* Gold */
    --dark-matte: #1a1a1a;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, .logo a {
    font-family: 'Playfair Display', serif;
}

/* Navbar */
.navbar {
    background-color: var(--dark-matte);
    color: white;
    padding: 1.2rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.nav-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 1.8rem;
    font-style: italic;
    letter-spacing: 1.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-item {
    color: white;
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.nav-item:hover {
    color: var(--accent-color);
}

.user-greeting {
    font-size: 0.9rem;
    color: #ccc;
    margin-right: 1rem;
    font-style: italic;
}

.logout-btn {
    background-color: transparent;
    border: 1px solid var(--accent-color);
    padding: 0.4rem 1rem;
    border-radius: 2px;
}
.logout-btn:hover {
    background-color: var(--accent-color);
    color: var(--dark-matte);
}

.content-wrapper {
    flex-grow: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

footer {
    text-align: center;
    padding: 3rem 2rem;
    background-color: var(--dark-matte);
    color: #888;
    font-size: 0.85rem;
    margin-top: auto;
}

/* Base Buttons */
.btn-primary {
    background-color: var(--dark-matte);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 0.75rem 2rem;
    border-radius: 2px;
    cursor: pointer;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.85rem;
    transition: all 0.4s ease;
}
.btn-primary:hover {
    background-color: var(--accent-color);
    color: var(--dark-matte);
}

.btn-secondary {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.5rem;
    border-radius: 2px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}
.btn-secondary:hover {
    background-color: #b5952f;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
}

.btn-disabled {
    background-color: #e0e0e0;
    color: #888;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 2px;
    cursor: not-allowed;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

/* Login Page */
.login-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 4rem 2rem;
}

.login-card {
    background: white;
    padding: 4rem 3rem;
    border-radius: 4px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 420px;
    text-align: center;
    border-top: 4px solid var(--accent-color);
}

.login-card h2 {
    margin: 0 0 0.5rem 0;
    font-weight: 400;
    font-size: 2.2rem;
}

.login-subtitle {
    color: #888;
    margin-bottom: 2.5rem;
    font-size: 0.95rem;
    font-style: italic;
}

.error-msg {
    background-color: #fff3f3;
    color: #d32f2f;
    padding: 1rem;
    border-radius: 2px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border-left: 4px solid #d32f2f;
}

.login-form .form-group {
    margin-bottom: 1.8rem;
    text-align: left;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #555;
}

.login-form input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 2px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
    background-color: #fafafa;
}
.login-form input:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: white;
}

.login-form .btn-primary {
    width: 100%;
    margin-top: 1rem;
    padding: 1rem;
}

/* Dashboard */
.dashboard-container {
    width: 90%;
    max-width: 1100px;
    margin: 4rem auto;
}

.dashboard-header {
    margin-bottom: 4rem;
    text-align: center;
}
.dashboard-header h2 {
    font-weight: 400;
    font-size: 2.5rem;
    margin: 0 0 1rem 0;
}
.role-badge {
    display: inline-block;
    background: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

.dash-card {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s;
    border: 1px solid #f0f0f0;
}

.dash-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.dash-card.disabled-card {
    opacity: 0.6;
}
.dash-card.disabled-card:hover {
    transform: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--dark-matte);
}

.dash-card h3 {
    margin: 0 0 1rem 0;
    font-weight: 400;
    font-size: 1.5rem;
}
.dash-card p {
    color: #777;
    font-size: 0.95rem;
    margin-bottom: 1.8rem;
    min-height: 45px;
    line-height: 1.5;
}

/* Mural Specific Additions */
header {
    text-align: center;
    padding: 3rem 1rem 1.5rem 1rem;
    width: 100%;
}
header h1 {
    font-size: 2.8rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
    font-style: italic;
}
.permissions-badge {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    background-color: transparent;
    color: #666;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Background Themes */
.theme-default { background-color: var(--wall-color); }
.theme-madera { 
    background-color: #8b5a2b; 
    background-image: repeating-linear-gradient(45deg, #7b4f26 0px, #7b4f26 10px, #8b5a2b 10px, #8b5a2b 20px); 
}
.theme-marmol { 
    background-color: #fcfcfc; 
    background-image: radial-gradient(circle, #ececec 10%, transparent 10%), radial-gradient(circle, #ececec 10%, transparent 10%);
    background-size: 60px 60px; 
    background-position: 0 0, 30px 30px;
}
.theme-terciopelo { 
    background-color: #2b0303; 
    background-image: radial-gradient(#3a0505 15%, transparent 16%), radial-gradient(#3a0505 15%, transparent 16%);
    background-size: 60px 60px;
    background-position: 0 0, 30px 30px;
}

.mural-container {
    width: 90%;
    max-width: 1300px;
    border-radius: 4px;
    padding: 3rem;
    box-shadow: inset 0 0 60px rgba(0,0,0,0.15), 0 20px 40px rgba(0,0,0,0.1);
    border: 15px solid #fff;
    overflow: hidden;
    position: relative; /* For spotlight */
    cursor: crosshair;
}

/* Spotlight Effect */
#spotlight {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 60%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    mix-blend-mode: overlay;
    z-index: 5;
    transition: opacity 0.3s;
    opacity: 0;
}
.mural-container:hover #spotlight {
    opacity: 1;
}

/* Entry Animation */
@keyframes slideFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.accessory-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: top center;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 10;
    
    /* Animation applied here */
    animation: slideFadeIn 1s ease-out forwards;
    opacity: 0; /* Starts hidden for the animation */
}
.accessory-item.draggable { cursor: grab; }
.accessory-item::before {
    content: ''; position: absolute; top: -12px; width: 6px; height: 6px; background-color: var(--accent-color); border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.3); z-index: 2;
}
.accessory-item::after {
    content: ''; position: absolute; top: -8px; width: 1px; height: 18px; background-color: rgba(212, 175, 55, 0.5); z-index: 1;
}
.accessory-img-container {
    width: 220px; height: 220px; background-color: transparent; display: flex; justify-content: center; align-items: center; margin-top: 10px;
}
.accesorio {
    max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(5px 10px 15px rgba(0, 0, 0, 0.3)); transition: filter 0.4s ease;
}
.accessory-name {
    margin-top: 1.5rem; 
    font-weight: 400; 
    font-size: 0.9rem; 
    color: #555; 
    background-color: rgba(255,255,255,0.9); 
    padding: 0.4rem 1.2rem; 
    border-radius: 2px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.accessory-item:hover {
    animation: pendulum 3s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    z-index: 20 !important;
}
.accessory-item:hover .accesorio {
    filter: drop-shadow(10px 20px 25px rgba(0, 0, 0, 0.4)) brightness(1.1);
}
@keyframes pendulum {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

/* Side Drawer (Luxury Info Panel) */
.side-drawer-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.4);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(4px);
}
.side-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.side-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 400px;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    z-index: 2000;
    transition: right 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    padding: 4rem 3rem;
    overflow-y: auto;
    border-left: 1px solid rgba(212, 175, 55, 0.3);
}

.side-drawer.open {
    right: 0;
}

.drawer-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}
.drawer-close:hover {
    color: var(--dark-matte);
}

.drawer-content h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: var(--dark-matte);
}

.drawer-category {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color);
    margin-bottom: 2rem;
    display: block;
}

.drawer-image-container {
    width: 100%;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2.5rem;
    background-color: #fbfbfb;
    border: 1px solid #eee;
    border-radius: 2px;
}
.drawer-image-container img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1));
}

.drawer-description {
    font-size: 1rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 2rem;
}

.drawer-details {
    list-style: none;
    padding: 0;
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
}

.drawer-details li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.drawer-details li span:first-child {
    color: #888;
}
.drawer-details li span:last-child {
    font-weight: 500;
    color: var(--dark-matte);
}

/* TOUCH ACTIONS FOR DRAGGABLES */
.accessory-item, .fitting-jewelry {
    touch-action: none;
}

/* MINIMUM TOUCH TARGET SIZES */
button, .btn-primary, .btn-secondary, .logout-btn, .catalog-item {
    min-height: 44px;
    min-width: 44px;
}

/* MOBILE MENU BTN */
.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
}

/* RESPONSIVE LAYOUT */
@media (max-width: 768px) {
    /* Navbar */
    .mobile-menu-btn {
        display: block;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: var(--dark-matte);
        position: absolute;
        top: 60px;
        left: 0;
        padding: 1rem 0;
        box-shadow: 0 10px 15px rgba(0,0,0,0.2);
        z-index: 9999;
    }
    .nav-links.active {
        display: flex;
    }
    .nav-container {
        flex-wrap: wrap;
    }
    
    /* Dashboard */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    /* Mural */
    .mural-layout {
        flex-direction: column;
        height: auto;
    }
    .mural-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    .mural-canvas {
        min-height: 60vh;
    }
    
    /* Probador */
    .probador-layout {
        flex-direction: column;
        height: auto;
    }
    .catalog-sidebar {
        width: 100%;
        max-height: 40vh;
    }
    .fitting-area {
        min-height: 60vh;
    }
    
    /* Side Drawer */
    .side-drawer {
        width: 100%;
        right: -100%;
    }
}
