/* File Sharing Service - Modern Dark Theme with Animations */
:root {
    --bg-primary: #0f0f14;
    --bg-secondary: #16161f;
    --bg-tertiary: #1e1e2a;
    --bg-hover: #252535;
    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --accent-glow: rgba(108, 92, 231, 0.4);
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #ff6b6b;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --text-muted: #666680;
    --border: #2a2a3a;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Auth Screen */
.auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1a2e 100%);
    animation: fadeIn 0.5s ease;
}

.auth-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow);
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: pulse 2s infinite;
}

.auth-box h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 14px;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#login-form input {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: var(--transition);
}

#login-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.error-text {
    color: var(--danger);
    font-size: 13px;
    margin-top: 8px;
    min-height: 20px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #5a4bd1);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-glow {
    box-shadow: 0 0 20px var(--accent-glow);
    animation: glow 2s ease-in-out infinite alternate;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

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

/* App Layout */
.app {
    min-height: 100vh;
    animation: fadeIn 0.3s ease;
}

.app.hidden, .hidden {
    display: none !important;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-small {
    font-size: 24px;
    animation: pulse 3s infinite;
}

.header-left h2 {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ws-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--bg-tertiary);
}

.ws-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    transition: var(--transition);
}

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

.ws-status.disconnected .ws-dot {
    background: var(--danger);
    animation: pulse 1s infinite;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    padding: 0 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.tab {
    padding: 14px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.tab.active {
    color: var(--accent-light);
    border-bottom-color: var(--accent);
}

/* Content */
.content {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
    margin-bottom: 16px;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.05);
    transform: scale(1.01);
}

.upload-zone.small {
    padding: 24px 16px;
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.upload-zone.small .upload-icon {
    font-size: 28px;
}

.upload-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.upload-subtext {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Text Input */
.text-input-zone {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.text-input-zone textarea {
    flex: 1;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.text-input-zone textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Section */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    margin-top: 24px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
}

/* Files List */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    animation: slideIn 0.3s ease;
}

.file-item:hover {
    border-color: var(--accent);
    background: var(--bg-tertiary);
}

.file-item.selected {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.1);
}

.file-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
    cursor: pointer;
}

.file-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.file-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.file-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
}

/* Texts List */
.texts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.text-item {
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    animation: slideIn 0.3s ease;
}

.text-item-content {
    font-size: 14px;
    word-break: break-word;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

.text-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Panels */
.panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.panel h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.panel-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 16px;
}

/* Uploads/Downloads Lists */
.uploads-list, .downloads-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.transfer-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    animation: slideIn 0.3s ease;
}

.transfer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.transfer-name {
    font-weight: 500;
    font-size: 14px;
}

.transfer-status {
    font-size: 12px;
    color: var(--accent-light);
}

.transfer-status.error {
    color: var(--danger);
}

.transfer-status.complete {
    color: var(--success);
}

.progress-bar {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 3px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 1.5s infinite;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

/* P2P */
.p2p-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.p2p-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.p2p-section h4 {
    font-size: 15px;
    margin-bottom: 12px;
}

.input-text {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    margin-bottom: 12px;
    transition: var(--transition);
}

.input-text:focus {
    border-color: var(--accent);
}

.p2p-file-list {
    margin: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.p2p-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-primary);
    border-radius: 6px;
    font-size: 13px;
}

.p2p-sessions {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.p2p-session-item {
    background: var(--bg-primary);
    border-radius: 6px;
    padding: 12px;
    border: 1px solid var(--border);
}

.p2p-session-item.active {
    border-color: var(--success);
    box-shadow: 0 0 8px rgba(0, 184, 148, 0.2);
}

.p2p-session-status {
    font-size: 12px;
    color: var(--accent-light);
    margin-top: 4px;
}

.p2p-available {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.p2p-available-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.p2p-available-item:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.p2p-available-name {
    font-weight: 500;
    font-size: 14px;
}

.p2p-available-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* P2P Notifications */
.p2p-notifications {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.p2p-notification {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.1), rgba(162, 155, 254, 0.05));
    border: 1px solid rgba(108, 92, 231, 0.3);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease, fadeIn 0.3s ease;
}

.p2p-notification-info {
    flex: 1;
}

.p2p-notification-title {
    font-weight: 500;
    font-size: 14px;
}

.p2p-notification-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    font-size: 14px;
    box-shadow: var(--shadow);
    animation: slideInRight 0.3s ease;
    max-width: 360px;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

.toast.info {
    border-color: var(--accent);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes glow {
    from { box-shadow: 0 0 20px var(--accent-glow); }
    to { box-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(108, 92, 231, 0.2); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .header-left h2 {
        font-size: 16px;
    }
    .header-right {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .header-right .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
    }
    .ws-text {
        display: none;
    }
    .tabs {
        padding: 0 12px;
    }
    .tab {
        padding: 12px 14px;
        font-size: 13px;
    }
    .content {
        padding: 16px;
    }
    .p2p-sections {
        grid-template-columns: 1fr;
    }
    .file-item {
        flex-wrap: wrap;
    }
    .file-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
    .text-input-zone {
        flex-direction: column;
    }
    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
    .toast {
        max-width: 100%;
    }
    .section-actions {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
