@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;500;600;700;800;900&display=swap');

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-bg: #ecf0f1;
    --dark-text: #2c3e50;
    --border-color: #bdc3c7;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--dark-text);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* Header Styles */
.header {
    background: #070540;
    padding: 20px 0;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    padding: 0 20px;
}

.header-logo {
    flex-shrink: 0;
}

.header-logo img {
    height: 80px;
    width: auto;
}

.header-text {
    flex: 1;
}

.header h1 {
    text-align: left;
    color: white;
    font-size: 1.25em;
    font-weight: 600;
    margin: 0;
}

.header p {
    text-align: left;
    color: white;
    margin-top: 10px;
    opacity: 0.9;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

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

/* Button Styles */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

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

.btn-success:hover {
    background: #229954;
}

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

.btn-danger:hover {
    background: #c0392b;
}

.btn-block {
    width: 100%;
}

/* Search Box */
.search-box {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.search-box .search-instruction {
    font-size: 18px;
    color: var(--dark-text);
    margin-bottom: 20px;
}

.search-input-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.search-input-group input {
    flex: 1;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

table thead {
    background: var(--primary-color);
    color: white;
}

table thead th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

table tbody td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

table tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-valid {
    background: #d4edda;
    color: #155724;
}

.status-expired {
    background: #f8d7da;
    color: #721c24;
}

.status-suspended {
    background: #fff3cd;
    color: #856404;
}

/* Alert Styles */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

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

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

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

/* Details Table */
.details-table {
    width: 100%;
    margin-top: 20px;
}

.details-table tr {
    border-bottom: 1px solid var(--border-color);
}

.details-table td {
    padding: 15px;
    vertical-align: top;
}

.details-table td:first-child {
    font-weight: 600;
    width: 35%;
    color: var(--primary-color);
    background: #f8f9fa;
}

/* Navigation */
.nav {
    background: var(--primary-color);
    padding: 15px 0;
    margin-bottom: 20px;
}

.nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.nav ul li a:hover {
    color: var(--secondary-color);
}

.nav .logout {
    margin-left: auto;
}

/* Modal/Popup Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: var(--primary-color);
}

.close-modal {
    font-size: 30px;
    cursor: pointer;
    color: var(--danger-color);
    line-height: 1;
}

/* Footer */
.footer {
    background: #070540;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-logo img {
        height: 60px;
    }
    
    .header h1 {
        font-size: 1.5em;
        text-align: center;
    }
    
    .header p {
        text-align: center;
    }
    
    .search-input-group {
        flex-direction: column;
    }
    
    .nav ul {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav .logout {
        margin-left: 0;
    }
    
    table {
        font-size: 14px;
    }
    
    table thead th,
    table tbody td {
        padding: 10px;
    }
}

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Link Styles */
a.view-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

a.view-link:hover {
    text-decoration: underline;
}

/* No Data Message */
.no-data {
    text-align: center;
    padding: 40px;
    color: var(--danger-color);
    font-size: 18px;
    font-weight: 600;
}
