:root {
    --bg-color: #2778e947;
    --card-bg: rgb(47 67 96 / 70%);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #c9d1d9;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #1f6feb;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: radial-gradient(circle at top right, #1f2430, transparent);
}

#app-container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    transition: max-width 0.3s ease;
}

#app-container.expanded {
    max-width: 900px;
}

.quill-editor {
    height: 180px;
    margin-bottom: 15px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    color: #fff;
    transition: height 0.3s ease;
}

#app-container.expanded .quill-editor {
    height: 400px;
}

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

header h2 {
    margin: 0;
}

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.glass-card.active {
    display: block;
}

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

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

input,
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-sizing: border-box;
    font-size: 16px;
    /* 16px prevents iOS zoom issue */
    transition: border 0.2s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn.primary {
    background: var(--accent);
    color: #fff;
}

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

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

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

.btn.text {
    background: transparent;
    color: var(--accent);
    padding: 8px;
}

.btn.text:hover {
    text-decoration: underline;
}

.btn.full-width {
    width: 100%;
}

.auth-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 12px;
    cursor: pointer;
    font-weight: 500;
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: var(--text-primary);
    border-color: var(--accent);
}

.tab-panel {
    display: none;
}

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

.result-box {
    margin-top: 16px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    word-break: break-all;
    font-size: 13px;
    color: #8b949e;
}

.result-box.success {
    border-color: #2ea043;
    color: #3fb950;
}

.result-box.error {
    border-color: #f85149;
    color: #ff7b72;
}

.result-box.hidden {
    display: none;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    body {
        align-items: flex-start;
        background-image: none;
    }

    #app-container,
    #app-container.expanded {
        padding: 0;
        max-width: 100%;
    }

    #app-container.expanded .quill-editor {
        height: 250px;
    }

    .glass-card {
        border-radius: 0;
        border: none;
        box-shadow: none;
        min-height: 100vh;
        padding: 24px 20px;
    }

    header {
        margin-bottom: 24px;
    }

    .btn {
        padding: 14px 24px;
    }

    .tab {
        padding: 14px 8px;
        font-size: 15px;
    }
}

/* Attachment Styles */
.hidden-input {
    display: none;
}

.attachment-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    font-size: 14px;
}

.attachment-label:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--accent);
}

.attachment-label.has-file {
    border-color: #2ea043;
    color: #3fb950;
    background: rgba(46, 160, 67, 0.1);
}

.received-attachment {
    margin-top: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.received-attachment img {
    max-width: 100%;
    border-radius: 4px;
    margin-top: 8px;
    display: block;
}

.received-attachment a.download-link {
    color: var(--accent);
    text-decoration: none;
    display: inline-block;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
}

.received-attachment a.download-link:hover {
    text-decoration: underline;
}

/* Security Footer Badges */
.security-footer {
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    pointer-events: none;
    z-index: 1000;
}

.security-footer .badge {
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid rgba(88, 166, 255, 0.4);
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.security-footer .badge::before {
    content: "🔒";
    font-size: 0.8rem;
}

@media (max-width: 600px) {
    .security-footer {
        position: relative;
        bottom: 0;
        padding-bottom: 20px;
        margin-top: 20px;
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        justify-content: center;
    }
    .security-footer .badge {
        padding: 4px 8px;
        font-size: 0.6rem;
        white-space: nowrap;
    }
}