.container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease-out;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Upload Zone */
.upload-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.6s ease-out;
}

.drop-zone {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.drop-zone:hover {
    border-color: #764ba2;
    background: linear-gradient(135deg, #e0e7ff 0%, #c3cfe2 100%);
    transform: translateY(-2px);
}

.drop-zone.dragover {
    border-color: #764ba2;
    background: linear-gradient(135deg, #e0e7ff 0%, #d4d9ff 100%);
    transform: scale(1.02);
}

.drop-zone-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.drop-zone h3 {
    color: #667eea;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.drop-zone p {
    color: #666;
    font-size: 1rem;
}

.file-input {
    display: none;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Results Section */
.results-section {
    display: none;
    animation: fadeInUp 0.6s ease-out;
}

.results-section.active {
    display: block;
}

.results-header {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.results-title {
    color: #667eea;
    font-size: 1.8rem;
}

.download-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.download-btn:active {
    transform: translateY(0);
}

/* Employee Cards */
.employees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.employee-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
}

.employee-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
}

.employee-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

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

.employee-info h3 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.employee-info .employee-id {
    color: #999;
    font-size: 0.9rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* Cambio alignment para permitir mejor flujo si hay wrap */
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    gap: 15px;
    /* Espacio mínimo entre label y valor */
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: #666;
    font-size: 0.95rem;
    font-weight: 500;
    flex-shrink: 0;
    /* Prevenir que el texto se encoja/corte */
    max-width: 60%;
    /* Limite para asegurar espacio al valor */
}

.stat-value {
    font-weight: bold;
    color: #333;
    font-size: 1rem;
    text-align: right;
    flex-grow: 1;
}

.stat-value.highlight {
    color: #667eea;
}

.stat-value.warning {
    color: #f59e0b;
}

.stat-value.danger {
    color: #ef4444;
}

.stat-value.success {
    color: #10b981;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge.success {
    background: #d1fae5;
    color: #065f46;
}

.badge.holiday {
    background: #fef3c7;
    color: #92400e;
    border: 2px solid #f59e0b;
}

.dates-list {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #d97706;
    background: #fffbeb;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.date-tag {
    background: rgba(255, 255, 255, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.date-detail {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.date-detail:last-child {
    border-bottom: none;
}

.time-info {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Collapsible dates styles */
.dates-toggle {
    background: #667eea;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.dates-toggle:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.dates-toggle-icon {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.dates-toggle.active .dates-toggle-icon {
    transform: rotate(180deg);
}

.dates-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.dates-content.active {
    max-height: 400px;
    overflow-y: auto;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .employees-grid {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        text-align: center;
    }
}

/* Error Message */
.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    display: none;
}

.error-message.active {
    display: block;
}

/* Chatbot Styles */
.chat-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
}

.chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.chat-sidebar {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.chat-sidebar.open {
    right: 0;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.close-btn:hover {
    opacity: 0.8;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f7fa;
}

.message {
    margin-bottom: 15px;
    animation: fadeInUp 0.3s ease;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.5;
}

.message-bubble p {
    white-space: pre-wrap;
}

.message-bubble ul {
    white-space: normal;
}

.message.user {
    text-align: right;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.message.bot .message-bubble {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 5px;
}

.message-time {
    font-size: 0.75rem;
    color: #999;
    margin-top: 5px;
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input-container input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s ease;
    min-width: 0;
    /* Permite que el input se encoja */
}

.chat-input-container input:focus {
    border-color: #667eea;
}

.chat-input-container button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    /* Evita que los botones se encojan */
    white-space: nowrap;
}

.chat-input-container button:hover {
    transform: scale(1.05);
}

.chat-input-container button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.typing-indicator {
    display: none;
    padding: 10px;
}

.typing-indicator.active {
    display: block;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-10px);
    }
}

@media (max-width: 768px) {
    .chat-sidebar {
        width: 100%;
        right: -100%;
    }

    .chat-toggle {
        bottom: 20px;
        right: 20px;
    }

    .chat-input-container button {
        padding: 12px 15px !important;
        font-size: 0.9rem;
    }
}

@media (min-width: 769px) {
    .chat-sidebar {
        width: 450px;
        right: -450px;
    }

    .chat-input-container {
        padding: 20px;
    }

    .chat-input-container button {
        padding: 12px 30px;
    }
}