:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Animation */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: move 20s infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: var(--primary);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: var(--secondary);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 40%;
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    animation-delay: -10s;
}

@keyframes move {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(50px, 50px);
    }
}

/* Glass Panel */
.app-container {
    width: 100%;
    max-width: 500px;
    min-height: 600px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin: 1rem;
    position: relative;
    overflow: hidden;
    transition: height 0.3s ease;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo i {
    color: var(--primary);
}

.highlight {
    color: var(--primary);
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.3);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-dot {
    width: 100%;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

/* Language Selector */
.lang-container {
    margin-left: auto;
    margin-right: 1.5rem;
}

.lang-selector {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    -webkit-appearance: none;
    appearance: none;
    text-align: center;
}

.lang-selector:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary);
}

.lang-selector option {
    background: #1e293b;
    color: var(--text-main);
}

.status-badge.connected .status-dot {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.status-badge.disconnected .status-dot {
    background: var(--error);
}

.status-badge.connecting .status-dot {
    background: #eab308;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Views */
.view {
    display: none;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.4s ease;
}

.view.active {
    display: flex;
}

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

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

.hero-text h1 {
    font-size: 2.5rem;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Persistent Tools */
#sender-persistent-tools {
    margin-bottom: 2rem;
}

/* Action Cards */
.action-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
}

.step-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.step-num {
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.step-text {
    font-weight: 600;
    color: var(--text-main);
}

.link-box {
    display: flex;
    gap: 0.5rem;
}

.link-box input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.link-box input:focus {
    border-color: var(--primary);
    color: var(--text-main);
}

.btn-icon {
    width: 46px;
    height: 46px;
    /* Match input height roughly */
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.btn-icon:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

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

.hint-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 3rem 1.5rem;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    cursor: pointer;
}

.drop-zone:hover:not(.disabled) {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.drop-zone.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-style: solid;
    /* Make it look inactive */
}

.icon-large {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: block;
}

.drop-zone h3 {
    margin-bottom: 0.5rem;
}

.drop-zone p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.drop-zone input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.drop-zone.disabled input {
    pointer-events: none;
}

/* Loading Spinner */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem 0;
    gap: 1.5rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--glass-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Transfer View */
.transfer-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 16px;
}

.file-icon {
    width: 50px;
    height: 50px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
}

.transfer-info h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.transfer-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.progress-container {
    margin-top: 0.5rem;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.2s linear;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.transfer-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hidden {
    display: none !important;
}

.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    border: none;
}

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

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 480px) {
    .app-container {
        border-radius: 0;
        min-height: 100vh;
        margin: 0;
    }
}

/* Header Buttons */
.icon-btn-header {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
    margin-right: auto;
    /* Push connection status to right if needed, or adjust flex */
    margin-left: 1rem;
}

.icon-btn-header:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 0.5rem;
        /* Less padding on mobile to maximize content area */
    }
}

.modal-content {
    background: #1e293b;
    /* Darker solid bg for readability */
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 100%;
    /* Fill available space respecting parent padding */
    max-width: 800px;
    /* Large max-width for less vertical scroll on desktops */
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e293b;
    z-index: 10;
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--text-main);
}

.modal-header .icon-btn-header {
    margin: 0;
    background: transparent;
}

.modal-header .icon-btn-header:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    background: #1e293b;
    z-index: 10;
}

.markdown-body {
    padding: 1.5rem;
    overflow-y: auto;
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Markdown Styles */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    color: var(--text-main);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.markdown-body h1:first-child {
    margin-top: 0;
}

.markdown-body p {
    margin-bottom: 1rem;
}

.markdown-body a {
    color: var(--primary);
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

.markdown-body code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85em;
}

.markdown-body pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.markdown-body pre code {
    background: none;
    padding: 0;
}

.version-display {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}