@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #141720;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
}

/* Fond subtil avec gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
    padding: 40px 20px 60px;
    width: 100%;
    max-width: 560px;
}

/* ========== LOGO ========== */
.logo-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.logo-img {
    max-width: 340px;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* ========== CREATE SECTION ========== */
.create-section {
    width: 100%;
}

/* ========== CARD ========== */
.card {
    background: rgba(30, 34, 48, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
}

.icon-create {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
}

.card h2 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.card-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.5;
}

/* ========== INPUT ========== */
.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 13px 16px;
    background: rgba(15, 17, 24, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.input-group input:focus {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ========== BUTTONS ========== */
.btn {
    padding: 13px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.btn-create {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.25);
}

.btn-create:hover {
    box-shadow: 0 6px 24px rgba(34, 197, 94, 0.35);
    transform: translateY(-1px);
}

.btn-create:active {
    transform: translateY(0);
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-confirm {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-confirm:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

/* ========== CONTROLLERS LIST SECTION ========== */
.controllers-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px;
}

.section-icon {
    font-size: 20px;
}

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.controllers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.empty-list {
    text-align: center;
    padding: 32px 20px;
    color: rgba(255, 255, 255, 0.2);
    font-size: 13px;
    font-style: italic;
    background: rgba(30, 34, 48, 0.4);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

/* ========== CONTROLLER ITEM ========== */
.controller-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(30, 34, 48, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.controller-item:hover {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(30, 34, 48, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.ctrl-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
    flex-shrink: 0;
}

.ctrl-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ctrl-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ctrl-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    display: flex;
    gap: 10px;
}

.ctrl-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.ctrl-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ctrl-btn-join {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.ctrl-btn-join:hover {
    background: rgba(59, 130, 246, 0.25);
}

.ctrl-btn-delete {
    background: rgba(244, 67, 54, 0.1);
    color: #f87171;
    border: 1px solid rgba(244, 67, 54, 0.15);
}

.ctrl-btn-delete:hover {
    background: rgba(244, 67, 54, 0.2);
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: #1e2230;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 28px 24px;
    width: 360px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.modal-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 4px;
}

/* ========== ERROR ========== */
.error-msg {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: #f87171;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    padding: 12px 24px;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.2);
    border-radius: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 200;
}

.error-msg.visible {
    opacity: 1;
    pointer-events: all;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
    .container {
        max-width: 100%;
        padding: 24px 16px 40px;
    }

    .logo-img {
        max-width: 260px;
    }
}
