:root {
    /* Color Palette - L'Antre de Lucifer */
    --accent-primary: hsl(354, 100%, 64%);
    /* Rouge Infernal */
    --accent-primary-glow: hsla(354, 100%, 64%, 0.4);
    --accent-secondary: hsl(28, 80%, 52%);
    /* Orange Magma */

    --accent-blue: var(--accent-primary);
    /* Pour compatibilite avec les classes existantes */
    --accent-red: hsl(354, 100%, 64%);
    --accent-green: hsl(145, 63%, 49%);
    --accent-orange: var(--accent-secondary);

    --bg-dark: hsl(220, 10%, 6%);
    --bg-darker: hsl(220, 10%, 4%);
    --sidebar-bg: hsla(220, 10%, 4%, 0.9);
    --panel-bg: hsla(223, 7%, 15%, 0.7);
    --panel-bg-solid: hsl(223, 7%, 12%);

    --text-main: hsl(210, 10%, 95%);
    --text-muted: hsl(214, 8%, 62%);
    --border-color: hsla(0, 100%, 50%, 0.1);

    --glass-blur: blur(15px);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --required-color: hsl(354, 100%, 64%);
}

/* Global Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 0% 0%, hsla(354, 100%, 64%, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, hsla(28, 80%, 52%, 0.08) 0%, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: var(--bg-dark);
    color: white;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    background: var(--bg-dark);
}

/* Modals & Notifications */
.malphas-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeInModal 0.3s ease;
}

.malphas-modal {
    background: var(--panel-bg-solid);
    border: 1px solid var(--accent-primary);
    border-radius: 24px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px var(--accent-primary-glow);
    animation: slideUpModal 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.malphas-modal h3 {
    font-size: 24px;
    font-weight: 900;
    color: var(--accent-primary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.malphas-modal p {
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 30px;
}

.malphas-modal-btns {
    display: flex;
    gap: 15px;
}

.malphas-modal-btn {
    flex: 1;
    padding: 15px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.malphas-modal-btn.cancel {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUpModal {
    from {
        transform: translateY(30px) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Form Controls */
.form-control,
input[type="text"],
input[type="color"],
input[type="url"],
input[type="number"],
select,
textarea {
    width: 100%;
    background-color: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 18px;
    color: white;
    font-size: 15px;
    outline: none;
    transition: var(--transition-smooth);
    font-family: 'Inter', sans-serif;
}

.form-control:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent-primary);
    background-color: black;
    box-shadow: 0 0 0 4px hsla(354, 100%, 64%, 0.15);
}

/* Hide number input spinners */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.required-star {
    color: var(--required-color);
    margin-left: 4px;
    font-weight: 900;
}

/* Sidebar Styling */
.sidebar {
    width: 300px;
    background: var(--sidebar-bg);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-header {
    padding: 40px 24px;
    text-align: center;
}

.sidebar-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-primary-glow);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.sidebar-logo:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 0 40px var(--accent-primary);
}

.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.guild-selector-container {
    padding: 0 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.guild-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    object-fit: cover;
    background: var(--bg-darker);
}

.guild-select {
    flex: 1;
    background: hsla(0, 0%, 100%, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 40px 12px 16px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 180px;
}

.guild-select option {
    background-color: hsl(220, 10%, 6%);
    color: white;
    padding: 10px;
}

.guild-select:hover {
    background-color: hsla(0, 0%, 100%, 0.08);
    border-color: var(--accent-blue);
}

.sidebar-nav {
    flex: 1;
    padding: 0 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 6px;
    transition: var(--transition-smooth);
    font-weight: 500;
    font-size: 15px;
}

.nav-item:hover {
    background: hsla(0, 0%, 100%, 0.05);
    color: var(--text-main);
    transform: translateX(8px);
}

.nav-item.active {
    background: hsla(354, 100%, 64%, 0.15);
    color: var(--accent-primary);
    font-weight: 700;
}

.user-profile-side {
    margin: 20px 12px;
    background: hsla(0, 0%, 100%, 0.03);
    border-radius: 16px;
    padding: 12px;
    border: 1px solid var(--border-color);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

.top-bar {
    height: 80px;
    min-height: 80px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: hsla(220, 10%, 10%, 0.6);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.content-body {
    padding: 40px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    animation: fadeInContent 0.5s ease-out;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Panels Styling */
.panel {
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 32px;
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

.panel:hover {
    border-color: hsla(0, 0%, 100%, 0.15);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.4);
}

.panel-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
    display: block;
}

/* Form Elements */
.form-group {
    margin-bottom: 28px;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Buttons Styling */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    font-weight: 700;
    border-radius: 14px;
    padding: 16px 32px;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px hsla(354, 100%, 64%, 0.3);
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px hsla(354, 100%, 64%, 0.4);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

.add-btn {
    background: hsla(0, 0%, 100%, 0.04);
    border: 2px dashed hsla(0, 0%, 100%, 0.1);
    color: var(--text-muted);
    padding: 20px;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-weight: 600;
    width: 100%;
}

.add-btn:hover {
    background: hsla(0, 0%, 100%, 0.08);
    border-color: var(--accent-primary);
    color: white;
}

/* Hero Banner */
.hero-banner {
    width: 100%;
    height: 300px;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 40px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-color);
}

.hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 10s linear;
}

.hero-banner:hover img {
    transform: scale(1.1);
}

.hero-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent 70%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px;
}

/* Discord Style Preview */
.discord-preview {
    background: #313338;
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid #1e1f22;
    margin-bottom: 12px;
    position: relative;
}

.embed-title {
    font-weight: 700;
    color: white;
    font-size: 16px;
    margin-bottom: 8px;
}

.embed-description {
    color: #dbdee1;
    font-size: 14px;
    line-height: 1.5;
}

.embed-image {
    width: 100%;
    border-radius: 8px;
    margin-top: 12px;
}

.embed-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    float: right;
    margin-left: 12px;
}

/* Markdown Toolbar */
.markdown-toolbar {
    background: var(--bg-darker);
    border-radius: 12px 12px 0 0;
    padding: 10px;
    display: flex;
    gap: 8px;
    border: 1px solid var(--border-color);
    border-bottom: none;
}

.img-placeholder {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: hsla(0, 0%, 100%, 0.02);
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

.img-placeholder:hover {
    background: hsla(0, 0%, 100%, 0.05);
    border-color: var(--text-muted);
}

.img-placeholder.dragover {
    border-color: var(--accent-primary);
    background: hsla(354, 100%, 64%, 0.1);
    color: white;
    box-shadow: inset 0 0 20px var(--accent-primary-glow);
    transform: scale(1.02);
}

.img-placeholder img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    object-fit: contain;
}

.md-btn {
    background: hsla(0, 0%, 100%, 0.08);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: var(--transition-smooth);
}

.md-btn:hover {
    background: hsla(0, 0%, 100%, 0.15);
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 32px;
    right: 32px;
    padding: 20px 32px;
    border-radius: 16px;
    background: var(--panel-bg-solid);
    color: white;
    font-weight: 600;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: translateX(120%);
    transition: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10000;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.notification.success {
    border-left: 6px solid var(--accent-green);
}

.notification.error {
    border-left: 6px solid var(--accent-red);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: hsla(0, 0%, 100%, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: hsla(0, 0%, 100%, 0.2);
}

/* Specific Layouts */
.roles-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
}

@media (max-width: 1200px) {
    .roles-layout {
        grid-template-columns: 1fr;
    }
}

/* Modals */
.malphas-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.malphas-modal {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.malphas-modal h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 30px;
    color: white;
}

.malphas-modal-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 30px;
}

.malphas-modal-btn {
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: 0.3s;
}

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

.malphas-modal-btn.cancel {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.malphas-modal-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

/* Stream Dashboard Layout */
.stream-layout {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 30px;
    height: calc(100vh - 120px);
}

.stream-controls {
    display: flex;
    flex-direction: column;
    gap: 30px;
    overflow-y: auto;
    padding-right: 10px;
}

.chat-panel {
    background: rgba(10, 10, 15, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.chat-tabs {
    display: flex;
    gap: 10px;
}

.chat-tab {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
    border: 1px solid transparent;
    text-transform: uppercase;
}

.chat-tab.active {
    background: var(--accent-primary);
    color: white;
}

.chat-tab:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
}

.chat-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
}

.chat-frame-container {
    flex: 1;
    position: relative;
    background: #000;
}

.chat-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 1400px) {
    .stream-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .chat-panel {
        height: 600px;
    }
}