/* Common CSS for WAIO Application - Modern Dark Theme */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #121212;
    --bg-tertiary: #1e1e1e;
    --bg-card: #1a1a1a;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --accent-primary: #8b5cf6;
    --accent-secondary: #a78bfa;
    --accent-hover: #7c3aed;
    --border-color: #2a2a2a;
    --border-hover: #3a3a3a;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(167, 139, 250, 0.1) 0px, transparent 50%);
    min-height: 100vh;
    color: var(--text-primary);
}

/* Container Styles */
.container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(139, 92, 246, 0.1);
    padding: 40px;
    max-width: 500px;
    width: 100%;
    backdrop-filter: blur(10px);
}

.container-large {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.container-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Typography */
h1 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 2.5em;
    text-align: center;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.8em;
}

h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.4em;
}

p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    background: var(--bg-tertiary);
}

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

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

/* Button Styles */
button,
.btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

button:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-primary));
}

button:active,
.btn:active {
    transform: translateY(0);
}

button:disabled,
.btn:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-full {
    width: 100%;
}

/* Navigation Bar */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    padding: 15px 0;
    backdrop-filter: blur(10px);
}

.navbar-content {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5em;
    font-weight: bold;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

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

.navbar-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 8px 12px;
    border-radius: 6px;
}

.navbar-links a:hover {
    color: var(--accent-secondary);
    background: rgba(139, 92, 246, 0.1);
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.profile-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-username {
    color: var(--accent-secondary);
    font-weight: 500;
    font-size: 0.95em;
    user-select: none;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    object-fit: cover;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
    display: block;
}

.profile-user-info:hover .profile-avatar {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.profile-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.profile-dropdown-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}


.profile-dropdown-item {
    display: block;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.9em;
    font-family: inherit;
    border-bottom: 1px solid var(--border-color);
}

.profile-dropdown-item:first-child {
    padding-top: 12px;
}

.profile-dropdown-item:last-of-type:not(.logout) {
    border-bottom: none;
}

.profile-dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--accent-secondary);
}

.profile-dropdown-item.logout {
    color: var(--error);
    border-top: 1px solid var(--border-color);
    border-bottom: none;
    margin-top: 4px;
}

.profile-dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

/* Alert Styles */
.alert {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    border-left: 4px solid;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-left-color: var(--error);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border-left-color: var(--success);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
    border-left-color: var(--info);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fcd34d;
    border-left-color: var(--warning);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
}

.modal h2 {
    text-align: center;
    color: var(--text-primary);
}

.modal .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    width: auto;
    transition: color 0.3s ease;
}

.modal .close:hover {
    color: var(--text-primary);
}

/* Card Styles */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.card-title {
    margin: 0;
    font-size: 1.3em;
    color: var(--text-primary);
}

.card-body {
    padding: 10px 0;
}

/* Grid Layout */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Stats Display */
.stat-card {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 28px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--accent-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--accent-primary);
}

.stat-label {
    font-size: 1em;
    color: var(--text-secondary);
    opacity: 0.9;
}

/* Compact stat cards */
.stat-card-compact {
    padding: 16px;
    background: var(--bg-card);
    border: 2px solid var(--accent-primary);
    color: var(--text-primary);
}

.stat-card-compact .stat-value {
    font-size: 1.8em;
    margin-bottom: 8px;
    color: var(--accent-primary);
}

.stat-card-compact .stat-label {
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* Stat groups */
.stat-group {
    margin-bottom: 30px;
}

.stat-group-title {
    color: var(--text-primary);
    font-size: 1.5em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

/* User table */
.user-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.user-table thead {
    background: var(--bg-tertiary);
}

.user-table th {
    padding: 12px;
    text-align: left;
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.user-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.user-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.user-table tbody tr:last-child td {
    border-bottom: none;
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
    border-radius: 6px;
}

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

.btn-warning:hover {
    background: #d97706;
}

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

.btn-info:hover {
    background: #2563eb;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 5% auto;
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    position: relative;
}

.modal-close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    position: absolute;
    right: 15px;
    top: 15px;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--text-primary);
}

.modal h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.modal p {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

/* Link Styles */
a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: var(--text-secondary);
}

.back-link a:hover {
    color: var(--accent-secondary);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

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

table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

table tr:hover {
    background: var(--bg-tertiary);
}

table tr:last-child td {
    border-bottom: none;
}

/* Section Styles */
.section {
    margin-bottom: 30px;
}

.section-title {
    border-bottom: 2px solid var(--accent-primary);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

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

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

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.hidden {
    display: none;
}

/* Mobile */
@media (max-width: 768px) {
    .navbar-content {
        flex-wrap: nowrap;
        gap: 10px;
        padding: 0 15px;
    }

    .navbar-brand {
        font-size: 1.2em;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .navbar-links {
        flex-shrink: 0;
        gap: 10px;
    }

    .profile-avatar {
        width: 32px;
        height: 32px;
    }

    .profile-dropdown-menu {
        right: 0;
        left: auto;
        min-width: 160px;
    }

    .container {
        padding: 24px;
    }

    .container-large {
        margin: 0 auto;
        padding: 0px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

