:root {
    --bg-color: #0f172a;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(30, 41, 59, 0.5);
    --accent-color: #38bdf8;
    --accent-hover: #0ea5e9;
    --accent-glow: rgba(56, 189, 248, 0.4);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --success: #22c55e;
    --error: #ef4444;
    --border: rgba(255, 255, 255, 0.12);
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    padding: 1rem;
}

/* DECORATION */
.blob, .blob-2 {
    position: fixed;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    filter: blur(120px);
    z-index: -1;
    opacity: 0.3;
    animation: move 20s infinite alternate;
}

.blob-2 {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

@keyframes move {
    from { transform: translate(-10%, -10%) rotate(0deg); }
    to { transform: translate(10%, 10%) rotate(45deg); }
}

.container {
    width: 100%;
    max-width: 950px;
    position: relative;
}

/* ANIMATIONS */
.fade-in { animation: fadeIn 1s ease forwards; }
.slide-up { animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

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

/* HEADER - COMPACT */
header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 100; /* Ensure header is above cards */
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    background: linear-gradient(to right, #fff, var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

.tagline {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 0.75rem;
}

/* SELECTION - COMPACT */
.selection-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.selection-card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transition: all 0.4s ease;
}

.selection-card:hover {
    transform: translateY(-8px);
    background: rgba(30, 41, 59, 0.7);
    border-color: var(--accent-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.icon-bg {
    width: 60px;
    height: 60px;
    background: rgba(56, 189, 248, 0.1);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
}

.selection-card h3 { font-size: 1.6rem; font-weight: 700; }
.selection-card p { color: var(--text-secondary); line-height: 1.5; max-width: 220px; font-size: 0.9rem; }

/* CARD - COMPACT */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.role-card { max-width: 550px; margin: 0 auto; }

.btn-back {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
}

.file-drop {
    border: 2px dashed var(--border);
    border-radius: 24px;
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-drop:hover { border-color: var(--accent-color); background: rgba(56, 189, 248, 0.05); }

.peer-id-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem 1.25rem;
    border-radius: 14px;
    border: 1px solid var(--border);
}

#my-peer-id { font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; }

/* BUTTONS */
.btn {
    background: var(--accent-color);
    color: #000;
    border: none;
    border-radius: 16px;
    padding: 1rem 1.75rem;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(56, 189, 248, 0.2);
}

.btn-copy {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-secondary { background: rgba(255, 255, 255, 0.05); color: #fff; border: 1px solid var(--border); }
.btn-error { background: rgba(239, 68, 68, 0.1); color: var(--error); border: 1px solid rgba(239, 68, 68, 0.1); }
.btn-error:hover { background: var(--error); color: #fff; }

/* PROGRESS */
.progress-container { display: none; flex-direction: column; gap: 0.5rem; }
.status-row { display: flex; justify-content: space-between; font-size: 0.85rem; font-weight: 600; }
.progress-bar { height: 10px; background: rgba(255, 255, 255, 0.05); border-radius: 100px; overflow: hidden; border: 1px solid var(--border); }
.progress-fill { height: 100%; background: var(--accent-color); width: 0%; transition: width 0.1s linear; }
.metrics-row { display: flex; justify-content: space-between; margin-top: 0.5rem; font-size: 0.75rem; color: var(--text-secondary); font-weight: 600; }

/* INFO */
.info-section { margin-top: 4rem; padding-top: 3rem; border-top: 1px solid var(--border); }
.info-section h3 { text-align: center; color: var(--text-secondary); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.3em; margin-bottom: 2rem; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.info-item { background: rgba(255, 255, 255, 0.02); border-radius: 24px; padding: 1.5rem; text-align: center; transition: all 0.3s; }
.info-item:hover { background: rgba(255, 255, 255, 0.04); }
.icon-sm { width: 32px; height: 32px; margin: 0 auto 1rem; }
.info-item h4 { font-size: 1rem; }
.info-item p { font-size: 0.85rem; }
.learn-more { background: none; border: none; color: var(--accent-color); font-weight: 700; cursor: pointer; margin-top: 1rem; text-transform: uppercase; font-size: 0.75rem; }
.details { max-height: 0; opacity: 0; overflow: hidden; transition: all 0.4s ease; font-size: 0.8rem; line-height: 1.5; color: var(--text-secondary); }
.info-item.expanded .details { max-height: 150px; opacity: 1; margin-top: 1rem; }
.version-badge {
    font-size: 0.65rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white !important;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: 800;
    margin-top: 6px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: inline-block;
    width: fit-content;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    -webkit-appearance: none;
    z-index: 1000;
    border: none;
}

.version-badge:hover {
    transform: translateY(-2px) scale(1.05);
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

/* TIPS SECTION */
.tips-section { margin-top: 4rem; margin-bottom: 6rem; }
.tips-section h3 { text-align: center; color: var(--text-secondary); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.3em; margin-bottom: 2rem; border-top: none; padding-top: 0; }
.tips-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.tip-box { background: rgba(255, 255, 255, 0.03); border-radius: 28px; padding: 2rem; border: 1px solid var(--border); transition: all 0.3s ease; }
.tip-box:hover { background: rgba(255, 255, 255, 0.05); transform: translateY(-5px); border-color: var(--accent-color); }
.tip-header { display: flex; align-items: center; gap: 12px; font-weight: 700; margin-bottom: 1.5rem; font-size: 1.1rem; }
.tip-box ul { list-style: none; padding: 0; }
.tip-box li { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1rem; padding-left: 1.5rem; position: relative; }
.tip-box li::before { content: "•"; position: absolute; left: 0; color: var(--accent-color); font-weight: 900; }
.tip-box.do .tip-header { color: var(--success); }
.tip-box.dont .tip-header { color: #f59e0b; }

/* MODAL STYLES */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 2.5rem;
    border-radius: 32px;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 1.5rem; right: 1.5rem;
    background: none; border: none;
    color: var(--text-secondary);
    font-size: 2rem; cursor: pointer;
}

.feature-list {
    list-style: none;
    margin-top: 1.5rem;
    text-align: left;
}

.feature-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.feature-list li strong { color: var(--text-primary); }

.subtitle {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.tagline {
    font-size: 1rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* PRO TIPS SECTION */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.tip-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.tip-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.tip-card h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.tip-card ul {
    list-style: none;
    padding: 0;
}

.tip-card li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
}

.tip-card li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

.success-tip h4 { color: var(--success); }
.warning-tip h4 { color: #f59e0b; }

.tips-section { margin-top: 4rem; margin-bottom: 6rem; }
.tips-section h3 { text-align: center; color: var(--text-secondary); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.3em; margin-bottom: 1.5rem; border-top: none; padding-top: 0; }
.tips-container { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.tip-box { background: rgba(255, 255, 255, 0.02); border-radius: 24px; padding: 1.5rem; border: 1px solid var(--border); }
.tip-header { display: flex; align-items: center; gap: 0.75rem; font-weight: 800; font-size: 0.9rem; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.05em; }
.tip-box ul { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.tip-box li { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.4; position: relative; padding-left: 1.25rem; }
.tip-box li::before { content: "•"; position: absolute; left: 0; color: var(--accent-color); font-weight: bold; }
.tip-box.do { border-left: 4px solid var(--success); }
.tip-box.dont { border-left: 4px solid var(--error); }
.tip-box.do .tip-header { color: var(--success); }
.tip-box.dont .tip-header { color: var(--error); }

.history-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1.5rem; }

/* CHATBOT */
.chat-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 2000; }
.chat-toggle-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 2rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 0.7rem;
    font-weight: 900;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-dark);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
}

.chat-toggle-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.6);
}

.chat-window {
    position: absolute;
    bottom: 4rem;
    right: 0;
    width: 320px;
    height: 420px;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 10rem);
    background: #111827;
    border: 1px solid var(--border);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
}

.chat-header { padding: 1rem; background: rgba(255, 255, 255, 0.03); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 0.9rem; }
.bot-status-dot { width: 6px; height: 6px; background: var(--success); border-radius: 50%; box-shadow: 0 0 10px var(--success); }
.chat-close-btn { background: none; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.chat-messages { flex: 1; padding: 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.75rem; }
.bot-msg, .user-msg { padding: 0.75rem 1rem; border-radius: 16px; font-size: 0.85rem; line-height: 1.4; max-width: 85%; }
.bot-msg { background: rgba(255, 255, 255, 0.05); align-self: flex-start; border-bottom-left-radius: 4px; }
.user-msg { background: var(--accent-color); color: #000; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-input-area { padding: 0.75rem; background: rgba(0, 0, 0, 0.2); display: flex; gap: 0.5rem; }
.chat-input-area input { flex: 1; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: 12px; padding: 0.6rem 1rem; color: #fff; outline: none; font-size: 14px; }
.chat-input-area button { background: var(--accent-color); color: #000; border: none; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; }

.received-file-item {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 24px;
    border: 1px solid var(--border);
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.video-preview {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: 16px;
    margin-top: 0.75rem;
    background: #000;
}

.action-group { display: flex; gap: 0.5rem; margin-top: 1rem; }
.btn-simple { flex: 1; background: rgba(255, 255, 255, 0.05); color: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 0.6rem; font-size: 0.85rem; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer; }
.btn-simple:hover { background: rgba(255, 255, 255, 0.1); }
.btn-simple-error { color: var(--error); }
.file-title { font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); text-align: center; word-break: break-all; }

/* MOBILE */
@media (max-width: 768px) {
    h1 { font-size: 2.8rem; }
    .selection-container { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr 1fr; }
    .card { padding: 1.75rem; }
}

@media (max-width: 480px) {
    .info-grid { grid-template-columns: 1fr; }
}
