/* Componentes Comunes - Botones, Formularios, Modales, Tablas */

/* Button Styles */
.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.btn-small {
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 12px;
    gap: 8px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    z-index: 1;
}

.btn:active {
    transform: scale(0.98);
}

.btn i {
    position: relative;
    z-index: 2;
}

.btn span {
    position: relative;
    z-index: 2;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #ed7ae8 0%, #f34458 100%);
    box-shadow: 0 8px 25px rgba(245, 87, 108, 0.6);
}

.btn-tertiary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

.btn-tertiary:hover {
    background: linear-gradient(135deg, #3d8bfe 0%, #00d4fe 100%);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.6);
}

.btn-outline {
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
    color: var(--text-dark);
    border: 3px solid transparent;
    background-clip: padding-box;
    border-radius: 18px;
    flex-direction: column;
    align-items: flex-start;
    padding: 30px;
    min-width: 280px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 18px;
    padding: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: subtract;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
}

.btn-outline:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(240, 147, 251, 0.1) 100%);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ff5252 0%, #e53e3e 100%);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.btn-success:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.6);
}

/* Form Styles */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.1rem;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 5px;
    border-radius: 50%;
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--text-dark);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    background: #f9fafb;
}

.modal form {
    padding: 30px;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table th,
.table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
}

.table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
    position: sticky;
    top: 0;
}

.table tbody tr:hover {
    background: #f9fafb;
}

.table .actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.table .actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

.table .actions .btn-edit {
    background: #e0f2fe;
    color: #0891b2;
}

.table .actions .btn-edit:hover {
    background: #0891b2;
    color: white;
}

.table .actions .btn-delete {
    background: #fee2e2;
    color: #dc2626;
}

.table .actions .btn-delete:hover {
    background: #dc2626;
    color: white;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
}

.stat-card:nth-child(1) {
    border-color: var(--primary-color);
}

.stat-card:nth-child(2) {
    border-color: var(--secondary-color);
}

.stat-card:nth-child(3) {
    border-color: var(--tertiary-color);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.stat-card:nth-child(1) .stat-icon {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.stat-card:nth-child(2) .stat-icon {
    background: rgba(6, 182, 212, 0.1);
    color: var(--secondary-color);
}

.stat-card:nth-child(3) .stat-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--tertiary-color);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-container i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.action-buttons {
    display: flex;
    gap: 12px;
}

/* Icon Buttons */
.btn-icon {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
}

.btn-icon[style*="color: var(--danger-color)"]:hover {
    background: var(--danger-color) !important;
    color: white !important;
}

/* Responsive Design para Componentes */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container {
        max-width: none;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal form,
    .modal-actions {
        padding: 20px;
    }
    
    .table-container {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 8px 12px;
    }
}
