/* 
 * Common CSS styles for the PERP Admin Panel
 * Consolidated from multiple files to reduce duplication
 */

:root {
    --bg: #1a0b2e;
    --card: #2d1b4e;
    --muted: #b8a9d9;
    --line: #4a2b7a;
    --text: #f0e6ff;
    --accent: #8b5cf6;
    --error: #ff6b6b;
    --success: #4ade80;
    --warning: #fbbf24;
    --info: #60a5fa;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #1a0b2e;
    color: #f0e6ff;
    line-height: 1.6;
}

.wrap {
    width: 80%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px;
}

@media (max-width: 1200px) {
    .wrap { width: 90%; max-width: none; }
}

@media (max-width: 768px) {
    .wrap { width: 95%; padding: 16px; }
}

/* Header Styles */
header {
    background: #2d1b4e;
    border: 1px solid #4a2b7a;
    border-radius: 8px;
    padding: 8px 16px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

@media (max-width: 768px) {
    header { 
        grid-template-columns: 1fr;
        gap: 12px; 
        padding: 12px; 
    }
    
    .stats-content {
        flex-direction: column;
        gap: 6px;
        text-align: center;
        white-space: normal;
        padding: 12px;
    }
    
    .header-right {
        justify-self: center;
        gap: 12px;
    }
    
    .user-details {
        flex-direction: row;
        gap: 8px;
    }
}

/* Header Left Section - Portal Title */
.header-left {
    display: flex;
    align-items: center;
}

.portal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

/* Header Center Section - Stats */
.header-center {
    display: flex;
    justify-content: center;
    align-items: center;
}



/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.notification-info {
    background: var(--info);
}

.notification-success {
    background: var(--success);
    color: #000;
}

.notification-error {
    background: var(--error);
}

.notification-warning {
    background: var(--warning);
    color: #000;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.stats-content {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--muted);
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
}

/* Header Right Section - User Info */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: end;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.user-details {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.username {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--line);
}

.badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.master {
    background: var(--accent);
    color: white;
}

.badge.user {
    background: var(--muted);
    color: var(--bg);
}

.badge.admin {
    background: var(--accent);
    color: white;
}

.logout {
    background: var(--error);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s ease;
}

.logout:hover {
    background: #e53e3e;
    transform: translateY(-1px);
}

/* Navigation Buttons */
.navigation-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: #7c3aed;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--line);
}

.btn-secondary:hover {
    background: var(--line);
    border-color: var(--accent);
}

.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--muted) !important;
    color: var(--text) !important;
    border-color: var(--line) !important;
}

.btn.disabled:hover {
    background: var(--muted) !important;
    border-color: var(--line) !important;
    transform: none;
    color: var(--text) !important;
}

/* Steam Profile Link Styles - Consistent across all pages */
.steam-profile-link {
    color: var(--error);
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: 14px;
}

.steam-profile-link:hover {
    color: var(--text);
    text-decoration: underline;
    transform: translateY(-1px);
}

.steam-icon {
    font-size: 12px;
}

/* Global Link Styles - Make all links red for better visibility */
a {
    color: var(--error);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--text);
    text-decoration: underline;
}

/* Override for specific link types that should keep their original colors */
.navigation-buttons a,
.btn,
.submit-btn {
    color: inherit;
    text-decoration: none;
}

.navigation-buttons a:hover,
.btn:hover,
.submit-btn:hover {
    text-decoration: none;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle::after {
    content: '▼';
    margin-left: 8px;
    font-size: 10px;
    transition: transform 0.2s ease;
}

.dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 200px;
    padding: 8px 0;
    margin: 4px 0 0 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    list-style: none;
    backdrop-filter: blur(10px);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

/* Disabled dropdown state */
.dropdown .btn.disabled + .dropdown-menu {
    display: none !important;
}

.dropdown .btn.disabled:hover .dropdown-menu {
    display: none !important;
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.dropdown-item:hover {
    background: var(--line);
    color: var(--text);
    text-decoration: none;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: left 0.3s ease;
}

.dropdown-item:hover::before {
    left: 100%;
}

/* Mobile responsiveness for dropdown */
@media (max-width: 768px) {
    .dropdown-menu {
        position: fixed;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        min-width: 250px;
        max-width: 90vw;
    }
    
    .dropdown-item {
        padding: 12px 16px;
        font-size: 16px;
    }
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

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

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text);
    opacity: 0.8;
}

.submit-btn {
    background: var(--accent);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.submit-btn:hover {
    background: #7c3aed;
    transform: translateY(-1px);
}



/* Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.table th {
    background: var(--line);
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tr:hover {
    background: rgba(139, 92, 246, 0.1);
}

/* Alert Styles */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid;
}

.alert-success {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
    color: var(--error);
}

.alert-warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
    color: var(--warning);
}

.alert-info {
    background: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.3);
    color: var(--info);
}

/* Section Headers */
.section-header {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.section-header h3 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navigation-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        justify-content: center;
    }
    
    .table {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 8px;
    }
    
    .user-status-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Auto-Update Status Styles */
.redis-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(124, 58, 237, 0.1);
    color: var(--accent);
    border: 1px solid rgba(124, 58, 237, 0.3);
    transition: all 0.3s ease;
}

.status-connected {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.3);
}

.status-disconnected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.3);
}





/* Access Denied Styles */
.access-denied-section {
    text-align: center;
    padding: 80px 40px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin: 40px 0;
}

.access-denied-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.7;
}

.access-denied-section h2 {
    color: var(--error);
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.access-denied-section p {
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.access-denied-note {
    color: var(--muted);
    font-size: 14px;
    font-style: italic;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .access-denied-section {
        padding: 60px 20px;
        margin: 20px 0;
    }
    
    .access-denied-icon {
        font-size: 48px;
        margin-bottom: 20px;
    }
    
    .access-denied-section h2 {
        font-size: 24px;
    }
    
    .access-denied-section p {
        font-size: 14px;
    }
}

/* Mobile responsiveness for dropdown */
@media (max-width: 768px) {
    .dropdown-menu {
        position: fixed;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        min-width: 250px;
        max-width: 90vw;
    }
    
    .dropdown-item {
        padding: 12px 16px;
        font-size: 16px;
    }
}

/* Additional dropdown enhancements */
.dropdown-menu {
    backdrop-filter: blur(10px);
    border: 1px solid var(--line);
}

.dropdown-item {
    position: relative;
    overflow: hidden;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: left 0.3s ease;
}

.dropdown-item:hover::before {
    left: 100%;
}

/* Form Styles */
