/* Base Variables */
:root {
    --primary-color: #E83C3C;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 10px;
}

/* Override primary color for subscription-specific pages */
.subscription-theme {
    --primary-color: #E83C3C;
}

/* Base Styles */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f5f7fa;
    color: #333;
}

.content-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Card Styles */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.card-header h3 {
    margin: 0;
    font-weight: 600;
    font-size: 1.25rem;
}

.card-body {
    padding: 0;
}

/* Subscription-specific Card Styles */
.subscription-card {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border: none;
    margin-bottom: 2rem;
    overflow: hidden;
}

.subscription-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.subscription-card .card-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem;
    border: none;
}

.subscription-card .card-header h3 {
    color: white;
}

.subscription-card .card-body {
    padding: 2rem;
}

/* Active Subscription Card */
.active-subscription-card {
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(232, 60, 60, 0.1);
    border: none;
    overflow: hidden;
}

.active-subscription-card .card-header {
    padding: 1.5rem;
    background: linear-gradient(45deg, #E83C3C, #f74a4a);
}

.active-subscription-card .card-header h3 {
    margin: 0;
    font-weight: 600;
    font-size: 1.25rem;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    padding: 0.5rem;
}

.generic-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.generic-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    border: none;
    color: var(--secondary-color);
}

.generic-table td {
    padding: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    vertical-align: middle;
}

.generic-table tr:hover {
    background-color: rgba(74, 108, 247, 0.05);
}

/* Specific Tables */
.subscription-table, .users-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.subscription-table th, .users-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    border: none;
    color: var(--secondary-color);
}

.subscription-table td, .users-table td {
    padding: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    vertical-align: middle;
}

.subscription-table tr:hover, .users-table tr:hover {
    background-color: rgba(74, 108, 247, 0.05);
}

/* Badge Styles */
.badge {
    padding: 0.5rem 0.75rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.75rem;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 1rem;
}

/* Status badges */
.status-badge.active, .badge-active, .badge-verified {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.status-badge.pending, .badge-pending {
    background-color: rgba(255, 193, 7, 0.25);
    color: #b38200;
    font-weight: 600;
}

.badge-cancelled {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.badge-expired {
    background-color: rgba(108, 117, 125, 0.1);
    color: var(--secondary-color);
}

.badge-not-verified {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

/* Role badges */
.badge-admin {
    background-color: rgba(247, 74, 74, 0.1);
    color: var(--primary-color);
}

.badge-client {
    background-color: rgba(108, 117, 125, 0.1);
    color: var(--secondary-color);
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    border: none;
    box-shadow: 0 4px 10px rgba(247, 74, 74, 0.3);
}

.btn-primary:hover {
    background-color: #d93a3a;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(247, 74, 74, 0.4);
}

.btn-danger {
    background-color: var(--danger-color);
    border: none;
}

.btn-secondary {
    background-color: var(--secondary-color);
    border: none;
}

.btn-success {
    background-color: var(--success-color);
    border: none;
}

/* Action Buttons */
.action-btn {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.75rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0.25rem;
    border: none;
    cursor: pointer;
}

.approve-btn {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.approve-btn:hover {
    background-color: var(--success-color);
    color: white;
}

.reject-btn, .delete-btn {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.reject-btn:hover, .delete-btn:hover {
    background-color: var(--danger-color);
    color: white;
}

.edit-btn {
    background-color: rgba(247, 74, 74, 0.1);
    color: var(--primary-color);
}

.edit-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.add-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(247, 74, 74, 0.3);
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(247, 74, 74, 0.4);
}

.add-btn i {
    margin-right: 0.5rem;
}

/* Alert Styles */
.alert {
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border: none;
    display: flex;
    align-items: center;
    animation: fadeIn 0.5s ease-out;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.2);
    color: #916900;
    border-left: 4px solid #ffc107;
}

.alert i {
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

/* Form Styles */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-control {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(247, 74, 74, 0.15);
}

.subscription-form {
    margin-top: 2rem;
}

/* Modal Styles */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

/* File Upload Styles */
.file-upload {
    position: relative;
    display: block;
    margin-bottom: 1rem;
}

.file-upload-label {
    display: block;
    padding: 1.5rem;
    border: 2px dashed #e9ecef;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.file-upload-label:hover {
    border-color: var(--primary-color);
}

.file-upload-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-text {
    margin-top: 1rem;
    color: var(--secondary-color);
}

.file-name {
    margin-top: 0.5rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* Progress Bar Styles */
.subscription-progress {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.progress-bar {
    height: 1rem;
    border-radius: 50px;
    background: #e9ecef;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-value {
    height: 100%;
    border-radius: 50px;
    transition: width 1.5s cubic-bezier(0.1, 0.5, 0.1, 1);
}

.progress-normal {
    background: linear-gradient(45deg, #56de72, #28a745);
}

.progress-medium {
    background: linear-gradient(45deg, #ff9a2e, #f17e05);
}

.progress-low {
    background: linear-gradient(45deg, #f74a4a, #e03a3a);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 4px solid rgba(74, 108, 247, 0.1);
    border-top-color: var(--primary-color);
    animation: spin 1.2s infinite linear;
}

.loading-text {
    margin-top: 20px;
    font-size: 18px;
    font-weight: 500;
    color: var(--primary-color);
}

/* Subscription Plan Styles */
.plan-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 2rem;
}

.plan-box {
    flex: 1;
    min-width: 250px;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
    position: relative;
}

.plan-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.plan-box.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.plan-title {
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.plan-title-large {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-top: 1rem;
    border-bottom: 2px solid rgba(232, 60, 60, 0.2);
    padding-bottom: 0.75rem;
}

.plan-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.plan-features {
    margin-bottom: 1.5rem;
}

.plan-feature {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.plan-feature i {
    color: var(--success-color);
    margin-right: 0.5rem;
    margin-top: 0.2rem;
}

.plan-feature.warning i {
    color: #e0a800;
}

.plan-select {
    display: none;
}

.plan-select-label {
    display: block;
    text-align: center;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.plan-select-label:hover {
    background-color: #e9ecef;
}

.plan-select:checked+.plan-select-label {
    background-color: var(--primary-color);
    color: white;
}

/* Subscription Details Styles */
.plan-details-section {
    background: rgba(232, 60, 60, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.details-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.plan-description {
    line-height: 1.7;
    color: #555;
}

/* Subscription Info Grid */
.subscription-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.info-card {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.info-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(232, 60, 60, 0.1);
    border-radius: 50%;
}

.info-content {
    flex: 1;
}

.info-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #888;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

/* Hours Remaining Section */
.hours-remaining-section {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin: 2rem 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.hours-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #444;
    font-size: 1.1rem;
}

.hours-display {
    background: #f9f9f9;
    padding: 1.25rem;
    border-radius: 10px;
}

.hours-count {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    justify-content: center;
    font-size: 1.25rem;
}

.hours-count .remaining {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.hours-count .separator {
    margin: 0 0.5rem;
    color: #ccc;
}

.hours-count .total {
    font-weight: 600;
    color: #777;
}

.hours-count .unit {
    margin-left: 0.75rem;
    color: #888;
    font-size: 1rem;
}

/* Justificatif Section */
.justificatif-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(255, 193, 7, 0.2);
    display: none;
}

/* Pending Message */
.pending-message {
    display: flex;
    align-items: flex-start;
    background: rgba(255, 193, 7, 0.15);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    border-left: 4px solid #ffc107;
}

.pending-message i {
    font-size: 2rem;
    color: #e0a800;
    margin-right: 1rem;
    animation: pulse 2s infinite;
}

.pending-message p {
    margin: 0;
    font-weight: 500;
    color: #916900;
    flex: 1;
}

/* Page Titles */
.page-title {
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

/* Utility Classes */
.text-warning-yellow {
    color: #b38200;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

/* Responsive Styles */
@media (max-width: 992px) {
    .subscription-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .subscription-info-grid {
        grid-template-columns: 1fr;
    }
    
    .info-card {
        padding: 1rem;
    }
    
    .hours-count {
        flex-direction: column;
        text-align: center;
    }
    
    .hours-count .separator,
    .hours-count .total {
        margin: 0.5rem 0;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .subscription-table, .users-table {
        min-width: 900px;
    }
    
    .subscription-table th, 
    .subscription-table td,
    .users-table th, 
    .users-table td {
        padding: 0.75rem;
    }
    
    .action-column {
        display: flex;
        flex-wrap: wrap;
    }
    
    .plan-container {
        flex-direction: column;
    }
    
    .plan-box {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .page-title {
        font-size: 1.5rem;
    }
}