* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Advanced Logo Animations - Elegant Motion */
@keyframes metalRotate {
    0%, 100% {
        transform: rotateZ(0deg);
    }
    50% {
        transform: rotateZ(3deg);
    }
}

@keyframes houseFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes shineGlide {
    0%, 100% {
        opacity: 0.15;
        transform: translateX(-10px);
    }
    50% {
        opacity: 0.35;
        transform: translateX(10px);
    }
}

@keyframes shimmerPulse {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.15);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

#sync-indicator {
    display: inline-block;
}

img[src*="logo.svg"] {
    animation: metalRotate 6s ease-in-out infinite, shimmerPulse 4s ease-in-out infinite;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.3));
    transform-origin: center center;
}

/* Welcome Video Styles */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

#welcomeVideoView video {
    display: block;
}

#welcomeVideoView button:hover {
    background: linear-gradient(135deg, #2563EB, #1D4ED8) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.5) !important;
}

#welcomeVideoView button:active {
    transform: translateY(0);
}

:root {
    /* Tema claro (por defecto) */
    --bg-primary: #ffffff;
    --bg-secondary: #f0f2f5;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #dddddd;
    --accent-color: #1877f2;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body.dark-theme {
    /* Tema oscuro */
    --bg-primary: #1e1e1e;
    --bg-secondary: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --border-color: #444444;
    --accent-color: #5ba3ff;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: background 0.3s, color 0.3s;
}

.container {
    max-width: 100%;
    padding: 1rem;
}

/* Header */
.header {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
        align-items: flex-start;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px var(--shadow-color);
    border-left: 5px solid var(--accent-color);
    transition: background 0.3s, box-shadow 0.3s;
}

.header h1 {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-time {
    background: var(--bg-secondary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: background 0.3s, color 0.3s;
}

/* Login */
.login-container {
    background: var(--bg-primary);
    max-width: 400px;
    margin: 5rem auto;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-color);
    text-align: center;
    transition: background 0.3s, box-shadow 0.3s;
}

.login-container h1 {
    color: var(--accent-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-container p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.1);
}

/* Botones */
.btn-primary {
    background: #1877f2;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    width: 100%;
}

.btn-primary:hover {
    background: #166fe5;
}

.btn-secondary {
    background: #f0f2f5;
    color: #1877f2;
    padding: 0.75rem 1.5rem;
    border: 2px solid #1877f2;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 1rem;
}

.btn-secondary:hover {
    background: #1877f2;
    color: white;
}

.btn-logout {
    background: #dc3545;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-logout:hover {
    background: #c82333;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.btn-success {
    background: #28a745;
    color: white;
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
}

/* Propiedades */
.properties-nav {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px var(--shadow-color);
    transition: background 0.3s, box-shadow 0.3s;
}

.properties-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.property-btn {
    background: var(--bg-secondary);
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.3s;
    text-align: left;
    font-size: 0.95rem;
}

.property-btn:hover {
    background: var(--border-color);
}

.property-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.property-btn:hover {
    border-color: var(--accent-color);
}

/* Secciones */
.section {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px var(--shadow-color);
    transition: background 0.3s, box-shadow 0.3s;
}

.section h2 {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.input-add {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 0.75rem;
    width: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.input-add:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.1);
}

.inventory-controls,
.tasks-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.inventory-controls input,
.tasks-controls input,
.tasks-controls select {
    flex: 1;
    min-width: 150px;
}

/* Listas */
.item-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-list li {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--accent-color);
    color: var(--text-primary);
    transition: background 0.3s;
}

.item-list li.completed {
    opacity: 0.6;
    text-decoration: line-through;
}

.task-item {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--accent-color);
    transition: background 0.3s;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.task-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.task-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
}

.task-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

/* Empleados */
.employees-list {
    display: grid;
    gap: 1rem;
}

.employee-card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #1877f2;
}

.employee-card h3 {
    color: #1877f2;
    margin-bottom: 0.5rem;
}

.employee-info {
    font-size: 0.9rem;
    color: #666;
    display: grid;
    gap: 0.25rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 6px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.modal-content h2 {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.modal-content .form-group {
    margin-bottom: 1rem;
}

.modal-content label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.modal-content input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
}

.modal-content input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 3px var(--accent-color);
}

.close {
    float: right;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
    background: none;
}

.close:hover {
    color: var(--text-primary);
}

/* Propiedad Info */
.property-info {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.property-info h2 {
    color: #1877f2;
    margin-bottom: 0.5rem;
}

.address {
    color: #666;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0.75rem;
    }

    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .header-info {
        flex-direction: column;
        width: 100%;
    }

    .inventory-controls,
    .tasks-controls {
        flex-direction: column;
    }

    .inventory-controls input,
    .tasks-controls input,
    .tasks-controls select {
        width: 100%;
        min-width: auto;
    }

    .inventory-controls button,
    .tasks-controls button {
        width: 100%;
    }

    .properties-list {
        flex-direction: column;
    }

    .property-btn {
        width: 100%;
    }
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.theme-toggle:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* Cleaning Tasks Sections */
.cleaning-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.cleaning-section .section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent-color);
}

.section-title-btn {
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-color);
    cursor: pointer;
    padding: 0.75rem;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s;
}

.section-title-btn:hover {
    background: var(--bg-secondary);
}

.section-title-btn.collapsed::before {
    content: '▶ ';
    margin-right: 0.5rem;
}

.section-title-btn:not(.collapsed)::before {
    content: '▼ ';
    margin-right: 0.5rem;
}

/* Estilos para secciones colapsables en vistas */
.collapsible-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px var(--shadow-color);
    overflow: hidden;
}

.collapsible-section-header {
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-color);
    cursor: pointer;
    padding: 0.75rem;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s;
}

.collapsible-section-header:hover {
    background: var(--bg-secondary);
}

.collapsible-section-content {
    max-height: 5000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 1rem 1rem 1rem;
}

.collapsible-section-content.collapsed {
    max-height: 0;
    padding: 0;
}

.section-content {
    max-height: 100% !important;
    overflow: visible !important;
    transition: max-height 0.3s ease;
}

.section-content.collapsed {
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

#ownerView section.section h2 {
    transition: background-color 0.2s ease;
}

#ownerView section.section h2:hover {
    background-color: var(--bg-secondary);
}

.section-content.collapsed {
    max-height: 0;
    overflow: hidden;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.tasks-list::-webkit-scrollbar {
    width: 8px;
}

.tasks-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

.tasks-list::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

.tasks-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Específico para listas de empleado */
#employeeTasksList,
#employeeScheduleList,
#employeePurchaseRequestsList {
    max-height: 90vh !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    min-height: 400px;
}

#employeeTasksList::-webkit-scrollbar,
#employeeScheduleList::-webkit-scrollbar,
#employeePurchaseRequestsList::-webkit-scrollbar {
    width: 8px;
}

#employeeTasksList::-webkit-scrollbar-track,
#employeeScheduleList::-webkit-scrollbar-track,
#employeePurchaseRequestsList::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

#employeeTasksList::-webkit-scrollbar-thumb,
#employeeScheduleList::-webkit-scrollbar-thumb,
#employeePurchaseRequestsList::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

#employeeTasksList::-webkit-scrollbar-thumb:hover,
#employeeScheduleList::-webkit-scrollbar-thumb:hover,
#employeePurchaseRequestsList::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.task-checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
}

.task-checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent-color);
    flex-shrink: 0;
}

.task-checkbox-group label {
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary);
    flex: 1;
    margin: 0;
}

.task-checkbox-group input[type="checkbox"]:checked + label {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.task-completed {
    opacity: 0.6;
    background: var(--bg-secondary);
}

.task-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent-color);
    border-radius: 2px;
}

.btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

/* Tabla de inventario compacta */
.inventory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: var(--bg-primary);
}

.inventory-table thead {
    background: var(--bg-secondary);
}

.inventory-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    min-width: 100px;
}

.inventory-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.inventory-table tbody tr:hover {
    background: var(--bg-secondary);
}

.inventory-item-input {
    width: 70px;
    padding: 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-align: center;
}

.inventory-item-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 3px var(--accent-color);
}

