/**
 * Common Styles
 * Shared styles used across admin and public dashboards
 *
 * @package    BIPP_Program
 * @subpackage Assets/CSS
 * @since      1.0.0
 */

/* Global SVG protection from theme/page builder interference */
[class*="bipp-"] svg {
    width: auto !important;
    height: auto !important;
    fill: none !important;
}

/* Elementor-specific overrides */
.elementor-widget-container [class*="bipp-"] svg,
.elementor-section [class*="bipp-"] svg,
.elementor [class*="bipp-"] svg {
    width: auto !important;
    height: auto !important;
    fill: none !important;
}

/* Reset Elementor's default SVG styles when inside BIPP components */
.bipp-dashboard svg,
.bipp-instructor-dashboard svg {
    width: auto !important;
    height: auto !important;
    fill: none !important;
}

/* Ensure stroke colors inherit from parent */
[class*="bipp-"] svg path,
[class*="bipp-"] svg circle,
[class*="bipp-"] svg rect,
[class*="bipp-"] svg line {
    stroke: currentColor !important;
    fill: none !important;
}

/* === GLOBAL RESETS === */
.bipp-dashboard *,
.bipp-student-dashboard *,
.bipp-instructor-dashboard * {
    box-sizing: border-box;
}

/* === CARDS === */
.bipp-card {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.bipp-card h2,
.bipp-card h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    color: #1e3a5f;
}

.bipp-card h2 {
    font-size: 22px;
}

.bipp-card h3 {
    font-size: 18px;
}

/* === BUTTONS === */
.bipp-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.bipp-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

.bipp-btn-primary {
    background-color: #1e3a5f;
    color: #ffffff;
}

.bipp-btn-primary:hover {
    background-color: #152d47;
    color: #ffffff;
}

.bipp-btn-secondary {
    background-color: #6c757d;
    color: #ffffff;
}

.bipp-btn-secondary:hover {
    background-color: #5a6268;
    color: #ffffff;
}

.bipp-btn-success {
    background-color: #28a745;
    color: #ffffff;
}

.bipp-btn-success:hover {
    background-color: #218838;
    color: #ffffff;
}

.bipp-btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.bipp-btn-warning:hover {
    background-color: #e0a800;
    color: #212529;
}

.bipp-btn-danger {
    background-color: #dc3545;
    color: #ffffff;
}

.bipp-btn-danger:hover {
    background-color: #c82333;
    color: #ffffff;
}

.bipp-btn-block {
    display: block;
    width: 100%;
}

.bipp-btn-large {
    padding: 15px 30px;
    font-size: 16px;
}

.bipp-btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.bipp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* === BADGES === */
.bipp-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bipp-badge-success {
    background-color: #d4edda;
    color: #155724;
}

.bipp-badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.bipp-badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.bipp-badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.bipp-badge-active {
    background-color: #d4edda;
    color: #155724;
}

.bipp-badge-failed {
    background-color: #f8d7da;
    color: #721c24;
}

.bipp-badge-cancelled {
    background-color: #e2e3e5;
    color: #383d41;
}

.bipp-badge-on-hold {
    background-color: #fff3cd;
    color: #856404;
}

/* === ALERTS === */
.bipp-alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.bipp-alert-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.bipp-alert-content {
    flex: 1;
}

.bipp-alert-content h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.bipp-alert-content p {
    margin: 0 0 10px 0;
}

.bipp-alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.bipp-alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.bipp-alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.bipp-alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* === MESSAGES === */
.bipp-message {
    padding: 12px 15px;
    border-radius: 4px;
    margin: 15px 0;
    font-size: 14px;
}

.bipp-success-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.bipp-error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.bipp-info-message {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.bipp-warning-message {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* === FORMS === */
.bipp-form {
    max-width: 600px;
}

.bipp-form-group {
    margin-bottom: 20px;
}

.bipp-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.bipp-input,
.bipp-select,
.bipp-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.bipp-input:focus,
.bipp-select:focus,
.bipp-textarea:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.bipp-textarea {
    resize: vertical;
    min-height: 100px;
}

.bipp-code-input {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    text-align: center;
    letter-spacing: 8px;
    text-transform: uppercase;
}

.bipp-help-text {
    font-size: 13px;
    color: #666;
    margin-top: 6px;
    line-height: 1.5;
}

/* === TABLES === */
.bipp-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.bipp-table thead {
    background-color: #f8f9fa;
}

.bipp-table th,
.bipp-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.bipp-table th {
    font-weight: 600;
    color: #333;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bipp-table td {
    font-size: 14px;
    color: #555;
}

.bipp-table tr:hover {
    background-color: #f8f9fa;
}

.bipp-table-responsive {
    overflow-x: auto;
}

/* === PROGRESS BAR === */
.bipp-progress-bar-container {
    margin: 20px 0;
}

.bipp-progress-bar {
    width: 100%;
    height: 30px;
    background-color: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bipp-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #34ce57 100%);
    border-radius: 15px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.bipp-progress-label {
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* === DROPDOWN === */
.bipp-dropdown {
    position: relative;
    display: inline-block;
}

.bipp-dropdown-toggle {
    background-color: #6c757d;
    color: #ffffff;
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.bipp-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #ffffff;
    min-width: 180px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid #ddd;
    border-radius: 4px;
    z-index: 1000;
    margin-top: 4px;
}

.bipp-dropdown:hover .bipp-dropdown-menu {
    display: block;
}

.bipp-dropdown-item {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.bipp-dropdown-item:hover {
    background-color: #f8f9fa;
    color: #1e3a5f;
}

/* === EMPTY STATE === */
.bipp-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
}

/* === LOADING SPINNER === */
.bipp-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1e3a5f;
    border-radius: 50%;
    animation: bipp-spin 1s linear infinite;
}

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

/* === UTILITY CLASSES === */
.bipp-text-center {
    text-align: center;
}

.bipp-text-right {
    text-align: right;
}

.bipp-text-muted {
    color: #666;
}

.bipp-mt-0 { margin-top: 0; }
.bipp-mt-1 { margin-top: 10px; }
.bipp-mt-2 { margin-top: 20px; }
.bipp-mt-3 { margin-top: 30px; }

.bipp-mb-0 { margin-bottom: 0; }
.bipp-mb-1 { margin-bottom: 10px; }
.bipp-mb-2 { margin-bottom: 20px; }
.bipp-mb-3 { margin-bottom: 30px; }

.bipp-hidden {
    display: none;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .bipp-card {
        padding: 15px;
    }
    
    .bipp-btn-large {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .bipp-table {
        font-size: 13px;
    }
    
    .bipp-table th,
    .bipp-table td {
        padding: 8px;
    }
}
