/* ============================================
   TOAST NOTIFICATIONS - Estilos Modernos
   ============================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: all;
    border-left: 4px solid #ccc;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(400px);
    opacity: 0;
}

/* Iconos de toast */
.toast i:first-child {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

/* Tipos de toast */
.toast-success {
    border-left-color: #10b981;
}

.toast-success i:first-child {
    color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-error i:first-child {
    color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-warning i:first-child {
    color: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
}

.toast-info i:first-child {
    color: #3b82f6;
}

/* Responsive */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* ============================================
   LOADING STATE & SPINNER
   ============================================ */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #0077b6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-state p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* ============================================
   ERROR MESSAGES
   ============================================ */

.error-details {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

.btn-retry {
    margin-top: 16px;
    padding: 10px 20px;
    background: #0077b6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-retry:hover {
    background: #005f8f;
    transform: translateY(-2px);
}

.cache-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #92400e;
}

.cache-warning i {
    color: #f59e0b;
    font-size: 16px;
}

/* ============================================
   FORM VALIDATION STYLES
   ============================================ */

.form-input,
.form-select,
.form-textarea {
    transition: all 0.2s ease;
}

.form-input.valid,
.form-select.valid,
.form-textarea.valid {
    border-color: #10b981;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2310b981' viewBox='0 0 16 16'%3E%3Cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-input.invalid,
.form-select.invalid,
.form-textarea.invalid {
    border-color: #ef4444;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23ef4444' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.error-message {
    display: block;
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    margin-bottom: 8px;
}

.error-message:empty {
    display: none;
}

.help-text {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-top: 4px;
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

.required {
    color: #ef4444;
    margin-left: 2px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: #374151;
}

/* Focus states mejorados */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: 2px solid #0077b6;
    outline-offset: 2px;
}

/* Skip to content link para accesibilidad */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #0077b6;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}
