/* Portal Homepage Styles */
/* Consolidated from inline styles - all styles in one place */

/* ========================================
   CSS Variables (Design System)
   ======================================== */
:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #7b68ee;
    --success-color: #38a169;
    --warning-color: #f6ad55;
    --warning-hover: #ed8936;
    --danger-color: #fc8181;
    --danger-hover: #f56565;
    --info-color: #4299e1;
    --info-hover: #3182ce;
    --white: #ffffff;
    --gray-100: #f7fafc;
    --gray-200: #e2e8f0;
    --gray-300: #e9ecef;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #718096;
    --gray-700: #4a5568;
    --gray-800: #2d3748;
    --gray-900: #212529;
    --border-radius-sm: 4px;
    --border-radius: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    --border-radius-full: 25px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --box-shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.1);
    --box-shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.3);
    --transition: all 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-800);
    line-height: 1.6;
}

/* ========================================
   Layout
   ======================================== */
.container {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: var(--box-shadow-lg);
    max-width: 1400px;
    width: 90%;
    margin: 0 auto;
    position: relative;
}

h1 {
    color: var(--gray-800);
    margin-bottom: 20px;
    text-align: center;
}

p {
    color: var(--gray-700);
    margin-bottom: 30px;
    line-height: 1.6;
    text-align: center;
}

/* ========================================
   Authentication Section
   ======================================== */
.auth-section {
    margin: 30px 0;
    text-align: center;
}

.auth-note {
    margin-top: 15px;
    font-size: 14px;
    color: var(--gray-600);
}

/* User Welcome Text (top left) */
.user-welcome {
    position: absolute;
    top: 20px;
    left: 20px;
    color: var(--gray-800);
    font-size: 16px;
    font-weight: 500;
}

.user-name {
    font-weight: 600;
    color: var(--primary-color);
}

/* Sign Out Button (top right) */
.btn-sign-out {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius-full);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-sign-out:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ========================================
   Apps Grid
   ======================================== */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.app-card {
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    padding: 30px;
    text-decoration: none;
    color: var(--gray-800);
    transition: var(--transition);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.app-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.app-card h3 {
    margin: 0 0 10px 0;
    color: var(--gray-800);
}

.app-card p {
    margin: 0;
    color: var(--gray-600);
    font-size: 14px;
    text-align: left;
}

.admin-card {
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    color: var(--gray-800);
}

.admin-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

/* ========================================
   Status Badges
   ======================================== */
.status {
    display: block;
    width: 100%;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
    text-align: left;
}

.status.active {
    background: #c6f6d5;
    color: #22543d;
}

.status.future {
    background: #fed7d7;
    color: #742a2a;
}

.status.admin {
    background: #fed7d7;
    color: #742a2a;
}

.status-good {
    color: var(--success-color);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 12px;
    padding: 8px 16px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

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

.btn-warning:hover {
    background: var(--warning-hover);
}

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

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

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

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

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

.btn-info:hover {
    background: var(--info-hover);
}

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

/* ========================================
   Modal Styles
   ======================================== */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--box-shadow-xl);
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideInUp 0.4s ease-out;
    margin: 0 auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 35px;
    border-bottom: 2px solid var(--gray-200);
    background: linear-gradient(135deg, #f8fafc 0%, var(--gray-200) 100%);
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
}

.modal-header h2 {
    margin: 0;
    color: var(--gray-800);
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #a0aec0;
}

.close:hover {
    color: var(--gray-800);
}

.modal-body {
    padding: 30px;
}

/* ========================================
   Admin Panel Styles
   ======================================== */
.admin-section {
    margin-bottom: 30px;
}

.admin-section h3 {
    color: var(--gray-800);
    margin-bottom: 15px;
    font-size: 18px;
}

.add-user-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.add-user-form input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    font-size: 14px;
}

.users-container {
    max-height: 300px;
    overflow-y: auto;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    background: var(--gray-100);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.user-email {
    font-weight: 600;
    color: var(--gray-800);
}

.user-role {
    font-size: 12px;
    color: var(--primary-color);
    background: #e6f3ff;
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
    display: inline-block;
    width: fit-content;
}

.user-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
    display: inline-block;
    width: fit-content;
}

.user-status.active {
    background: #c6f6d5;
    color: #22543d;
}

.user-status.blocked {
    background: #fed7d7;
    color: #742a2a;
}

.user-actions {
    display: flex;
    gap: 10px;
}

.admin-badge {
    color: #ff6b6b;
    font-weight: 600;
    font-size: 12px;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--gray-100);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

.stat-label {
    font-weight: 600;
    color: var(--gray-700);
}

.stat-value {
    font-weight: 700;
    color: var(--gray-800);
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    body {
        padding: 20px;
    }
    
    .container {
        padding: 20px;
        width: 95%;
    }
    
    .app-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .app-card {
        padding: 20px;
        min-height: auto;
    }
    
    .user-welcome {
        position: relative;
        top: 0;
        left: 0;
        margin-bottom: 15px;
        text-align: center;
    }
    
    .btn-sign-out {
        position: relative;
        top: 0;
        right: 0;
        margin: 0 auto 20px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .app-card {
        padding: 15px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header,
    .modal-body {
        padding: 20px;
    }
}
