@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #0a0b0d;
    --bg-card: rgba(22, 26, 33, 0.6);
    --border-color: rgba(255, 255, 255, 0.06);
    --text-primary: #f0f2f5;
    --text-secondary: #8c9ba5;
    --primary-gradient: linear-gradient(135deg, #00d2ff 0%, #00f5d4 100%);
    --discord-color: #5865F2;
    --discord-hover: #4752C4;
    --success-color: #00f5d4;
    --error-color: #ff3b30;
    --glow-violet: rgba(123, 44, 191, 0.15);
    --glow-cyan: rgba(0, 210, 255, 0.12);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background Glowing Orbs */
body::before, body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    pointer-events: none;
}

body::before {
    width: 450px;
    height: 450px;
    background: var(--glow-violet);
    top: -10%;
    left: -10%;
}

body::after {
    width: 400px;
    height: 400px;
    background: var(--glow-cyan);
    bottom: -10%;
    right: -10%;
}

/* Auth Landing Page */
.auth-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 100%;
    max-width: 450px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 0.6s ease-out;
}

.logo-container {
    margin-bottom: 30px;
}

.logo-glow {
    font-size: 3rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    display: inline-block;
}

.logo-glow::after {
    content: 'O-LOCK';
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: blur(15px);
    opacity: 0.7;
}

.auth-card h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.auth-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 30px;
    line-height: 1.5;
}

.btn-discord {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--discord-color);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(88, 101, 242, 0.3);
    width: 100%;
}

.btn-discord:hover {
    background-color: var(--discord-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(88, 101, 242, 0.4);
}

.btn-discord svg {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Dashboard Layout */
.dashboard-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    flex: 1;
}

/* Header Panel */
.dashboard-header {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.dashboard-title {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #00d2ff;
}

.user-info {
    text-align: left;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
}

.btn-logout {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.btn-logout:hover {
    color: var(--error-color);
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    text-align: left;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Grid Layout for Form and Table */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media(min-width: 992px) {
    .main-grid {
        grid-template-columns: 350px 1fr;
    }
}

/* Action Panel (Create key form) */
.form-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    height: fit-content;
}

.panel-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    padding-left: 12px;
}

.panel-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    width: 4px;
    height: 16px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    font-family: inherit;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-group input:focus {
    border-color: #00d2ff;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.15);
}

.btn-submit {
    width: 100%;
    background: var(--primary-gradient);
    color: #000000;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-submit:hover {
    opacity: 0.9;
    transform: scale(0.99);
}

/* List Panel */
.list-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* Table Design */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 14px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

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

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.mono {
    font-family: 'Consolas', 'Fira Code', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.badge-res {
    background: rgba(0, 210, 255, 0.1);
    color: #00d2ff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.badge-ip {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
}

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

.btn-action {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.btn-action.btn-change:hover {
    border-color: #00d2ff;
    color: #00d2ff;
    background: rgba(0, 210, 255, 0.05);
}

.btn-action.btn-delete:hover {
    border-color: var(--error-color);
    color: var(--error-color);
    background: rgba(255, 59, 48, 0.05);
}

/* Notification Banners */
.alert {
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    animation: fadeIn 0.4s ease;
}

.alert-success {
    background: rgba(0, 245, 212, 0.1);
    border: 1px solid rgba(0, 245, 212, 0.2);
    color: var(--success-color);
}

.alert-error {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.2);
    color: var(--error-color);
}

.alert-key-reveal {
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.25);
    color: #00d2ff;
    font-family: monospace;
    font-weight: 700;
    font-size: 1.05rem;
    justify-content: center;
    letter-spacing: 1px;
}

/* Keyframe Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal Popup Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #11141a;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.modal-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.4;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cancel {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.2);
}

.btn-confirm {
    background: var(--primary-gradient);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    transition: opacity 0.2s ease;
}

.btn-confirm:hover {
    opacity: 0.9;
}

.btn-confirm-delete {
    background: var(--error-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    transition: opacity 0.2s ease;
}

.btn-confirm-delete:hover {
    opacity: 0.9;
}
