/**
 * Main CSS - Common styles across all pages
 * Includes navbar, forms, buttons, alerts, modals, and general layout
 */

/* ============================================
   Reset & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* ============================================
   Navbar Styles
   ============================================ */
.navbar {
    background: white;
    border-bottom: 1px solid #e0e6ed;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar h1 {
    font-size: 24px;
    color: #2c3e50;
    font-weight: 600;
}

.navbar-links {
    display: flex;
    gap: 20px;
}

.navbar-links a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.navbar-links a:hover {
    color: #667eea;
}

/* ============================================
   Layout & Container
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.container-narrow {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
}

/* ============================================
   Cards & Panels
   ============================================ */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #e0e6ed;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    background: #f9fafb;
    border-top: 1px solid #e0e6ed;
}

.profile-card {
    background: white;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ============================================
   Headers & Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5em;
    color: #2c3e50;
}

h1 {
    font-size: 32px;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

.profile-header {
    margin-bottom: 30px;
}

.profile-header h1 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.profile-header p {
    color: #666;
    font-size: 14px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e6ed;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.read-only-group {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.read-only-group label {
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.read-only-group .value {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
}

.password-hint {
    color: #666;
    font-size: 12px;
    margin-top: 4px;
}

.section-divider {
    margin: 20px 0 0 0;
    padding: 15px 0 0 0;
    border-top: 1px solid #e0e6ed;
}

/* ============================================
   Button Styles
   ============================================ */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    white-space: nowrap;
    background: #667eea;
    color: white;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #999;
    color: white;
}

.btn-secondary:hover {
    background: #777;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background-color: #c0392b;
}

.btn-small {
    padding: 8px 12px;
    font-size: 13px;
}

.btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

/* ============================================
   Alert & Notification Styles
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

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

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

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

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

.info-box {
    background: #f0f4ff;
    border: 1px solid #d4e4ff;
    border-radius: 6px;
    padding: 12px;
    color: #667eea;
    font-size: 13px;
    margin-bottom: 20px;
}

/* ============================================
   Badge Styles
   ============================================ */
.badge {
    display: inline-block;
    padding: 4px 8px; 
    border-radius: 4px; 
    font-size: 11px; 
    margin-right: 8px;
    font-weight: 600;
    background: #f0f0f0;
    color: #666;
}

.badge.admin {
    background: #f8d7da;
    color: #721c24;
}

.badge.contributor {
    background: #fff3cd;
    color: #856404;
}

.badge.user {
    background: #d1ecf1;
    color: #0c5460;
}

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

.badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* ============================================
   Modal Styles
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
            max-height: 90vh;
            overflow-y: auto;
}

.modal-header {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 1px solid #e0e6ed;
}

.modal-body {
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.modal-buttons button {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.modal-buttons .btn-submit {
    background: #667eea;
    color: white;
}

.modal-buttons .btn-submit:hover {
    background: #5568d3;
}

.modal-buttons .btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.modal-buttons .btn-cancel:hover {
    background: #e0e0e0;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center {
    text-align: center;
}

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

.text-muted {
    color: #999;
}

.text-danger {
    color: #e74c3c;
}

.text-success {
    color: #27ae60;
}

.text-info {
    color: #667eea;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-20 {
    padding: 20px;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .navbar {
        flex-direction: column;
        gap: 15px;
    }

    .navbar h1 {
        font-size: 20px;
    }

    .navbar-links {
        width: 100%;
        justify-content: center;
    }

    .modal-content {
        width: 95%;
    }
}
