/* Variables Discord-like */
:root {
    --bg-primary: #1e1f22;
    --bg-secondary: #2b2d31;
    --bg-tertiary: #313338;
    --bg-hover: #404249;
    --accent: #5865f2;
    --accent-hover: #4752c4;
    --text-primary: #f2f3f5;
    --text-secondary: #b5bac1;
    --text-muted: #80848e;
    --success: #23a559;
    --warning: #f0b232;
    --danger: #f23f43;
    --border: #3f4147;
    --shadow: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #1e1f22 0%, #2b2d31 100%);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 14px;
}

/* Navbar */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px var(--shadow);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    text-decoration: none;
    cursor: pointer;
}

.nav-brand h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent);
}

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

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 8px 24px var(--shadow);
    max-width: 600px;
    margin: 4rem auto;
}

.hero h2 {
    font-size: 28px;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--accent) 0%, #7289da 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.btn-large {
    padding: 1rem 2rem;
    font-size: 16px;
}

.btn-primary:disabled {
    background: var(--bg-hover);
    cursor: not-allowed;
    transform: none;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 20px;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Centrer le header sur la page de config */
#configPage .page-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2rem;
}

/* Servers Grid */
.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.server-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.server-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.server-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
}

.server-card:hover::before {
    transform: scaleX(1);
}

.server-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    margin-bottom: 1rem;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
}

.server-icon img {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    object-fit: cover;
}

.server-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.server-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.server-status.active {
    background: rgba(35, 165, 89, 0.2);
    color: var(--success);
}

.server-status.inactive {
    background: rgba(242, 63, 67, 0.2);
    color: var(--danger);
}

.server-invite {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    display: block;
    font-weight: 600;
    transition: background 0.2s;
}

.server-invite:hover {
    background: var(--accent-hover);
}

/* Config Form */
.config-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section h3 {
    font-size: 20px;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.2);
}

.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 12px;
}

/* Variable Buttons */
.variable-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.btn-variable,
.btn-variable-channel {
    padding: 0.375rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-variable:hover,
.btn-variable-channel:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-variable:active,
.btn-variable-channel:active {
    transform: translateY(0);
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}

.status-badge.premium {
    background: rgba(35, 165, 89, 0.2);
    color: var(--success);
}

.status-badge.false {
    background: rgba(242, 63, 67, 0.2);
    color: var(--danger);
}

.form-actions {
    margin-top: 2rem;
}

/* Alert */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-warning {
    background: rgba(240, 178, 50, 0.15);
    border: 1px solid rgba(240, 178, 50, 0.3);
    color: var(--warning);
}

/* Centrer l'alerte sur la page de config */
#configPage .alert {
    max-width: 800px;
    margin: 0 auto 1.5rem;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 8px 24px var(--shadow);
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

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

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.info {
    border-left: 4px solid var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .hero h2 {
        font-size: 24px;
    }

    .servers-grid {
        grid-template-columns: 1fr;
    }

    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-brand h1 {
        font-size: 24px;
    }

    .toast-container {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .toast {
        min-width: auto;
    }
}

/* Styles pour la sélection de bannières */
.banner-selector {
    margin-top: 10px;
}

.banners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.banner-item {
    position: relative;
    border: 3px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    aspect-ratio: 16/9;
    background: var(--bg-tertiary);
}

.banner-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.banner-item.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-item .banner-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    color: var(--text-primary);
}

.banner-item .banner-delete {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(242, 63, 67, 0.9);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.banner-item:hover .banner-delete {
    display: flex;
}

.banner-item .banner-delete:hover {
    background: var(--danger);
}

.banner-upload-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.upload-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 600;
}

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

/* Prévisualisation */
.preview-container {
    margin-top: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    text-align: center;
}

.preview-loading {
    margin-top: 12px;
    padding: 32px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    text-align: center;
}

.preview-loading .spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
}

.preview-loading p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Indicateur de stockage */
.storage-indicator {
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.storage-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.storage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, var(--warning) 70%, var(--danger) 90%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.storage-bar-fill.warning {
    background: var(--warning);
}

.storage-bar-fill.danger {
    background: var(--danger);
}

/* Social Subscriptions */
.subscription-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1rem;
    align-items: center;
    transition: all 0.2s ease;
}

.subscription-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.subscription-platform {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.subscription-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.subscription-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.subscription-identifier {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}

.subscription-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.subscription-status {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.subscription-status.live {
    background: #f2383522;
    color: #f23835;
}

.subscription-status.offline {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.subscription-status.latest {
    background: var(--success);
    color: white;
}

.subscription-delete {
    padding: 0.5rem 1rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.subscription-delete:hover {
    background: #d93437;
    transform: scale(1.05);
}

/* Code blocks */
code {
    background: var(--bg-tertiary);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--accent);
}


