/* ==========================================================================
   PORTAL SPECIFIC STYLES (App Grid, Welcome Section, Auth)
   ========================================================================== */

body {
    background: radial-gradient(circle at top right, #f8fafc 0%, #eef2ff 100%);
    min-height: 100vh;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    margin-bottom: 5rem;
    margin-top: 4rem;
    animation: fadeInDown 0.8s ease-out;
}

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

.welcome-title {
    font-size: 4rem;
    font-weight: 950;
    letter-spacing: -0.06em;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-desc {
    color: var(--text-muted);
    font-size: 1.5rem;
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto;
}

/* App Cards in Grid */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.app-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 3.5rem 2rem;
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    text-decoration: none;
    color: inherit;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
}

.app-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: var(--primary);
    background: white;
    box-shadow: 0 30px 60px -12px rgba(37, 99, 235, 0.15);
}

.app-icon {
    font-size: 5rem;
    margin-bottom: 2rem;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.app-card:hover .app-icon {
    transform: scale(1.1);
}

.app-title {
    font-size: 1.75rem;
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.app-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Auth Cards (Portal Login) */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: 
        radial-gradient(circle at 0% 0%, #eff6ff 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, #f1f5f9 0%, transparent 50%),
        #ffffff;
}

.auth-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 32px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.auth-card h1 {
    font-size: 2.25rem;
    font-weight: 950;
    letter-spacing: -0.05em;
    margin-bottom: 0.75rem;
    text-align: center;
    color: var(--text-main);
}

.auth-desc {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.6rem;
    display: block;
}

.form-group input {
    background: #f8fafc;
    border: 1.5px solid var(--border-color);
}

/* ==========================================================================
   MOBILE RESPONSIVENESS (Portal Specific)
   ========================================================================== */
@media (max-width: 768px) {
    .welcome-title { font-size: 2.5rem; }
    .welcome-desc { font-size: 1.1rem; }
    .welcome-section { margin-bottom: 3rem; margin-top: 2rem; }
    
    .grid-cards { grid-template-columns: 1fr; gap: 1rem; }
    .app-card { padding: 2rem; border-radius: 24px; }
    .app-icon { font-size: 3.5rem; margin-bottom: 1rem; }
    
    .login-wrapper { padding: 1rem; }
    .auth-card { padding: 2rem; border-radius: 24px; }
    .auth-card h1 { font-size: 1.75rem; }
}

/* ==========================================================================
   USER MANAGEMENT (users.php)
   ========================================================================== */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.user-card {
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

.user-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.user-summary {
    padding: 1.25rem 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 1.5rem;
    cursor: pointer;
    user-select: none;
}

.user-avatar {
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
}

.user-info-brief h3 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
}

.user-info-brief p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.user-tag {
    padding: 0.3rem 0.75rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag-admin { background: #fee2e2; color: #b91c1c; }
.tag-user { background: #f1f5f9; color: #475569; }

/* Expanded Logic */
.user-details {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0, 1, 0, 1);
    background: #fafafa;
}

.user-card.expanded .user-details {
    max-height: 1500px;
    transition: all 0.5s ease-in-out;
    border-top: 1px solid var(--border-color);
}

.details-content {
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.detail-section-title {
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: block;
    letter-spacing: 0.05em;
}

.expand-icon {
    transition: transform 0.3s ease;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.user-card.expanded .expand-icon {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .user-summary { grid-template-columns: auto 1fr auto; }
    .user-summary .user-tag { display: none; }
    .details-content { grid-template-columns: 1fr; }
}
