:root {
    --bg-color: #0f1419;
    --card-bg: rgba(21, 24, 28, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --primary-color: #1d9bf0;
    --primary-hover: #1a8cd8;
    --text-primary: #e7e9ea;
    --text-secondary: #71767b;
    --danger-color: #f4212e;
    --success-color: #00ba72;
    --warning-color: #ffd400;
    --radius-lg: 16px;
    --radius-md: 10px;
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(29, 155, 240, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(120, 86, 255, 0.06) 0%, transparent 40%);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.hidden {
    display: none !important;
}

/* Login Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    width: 90%;
    max-width: 400px;
    padding: 32px;
    text-align: center;
}

.modal-header .x-logo {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 6px;
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

/* App Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
}

/* Header Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin-bottom: 24px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-brand .x-icon {
    font-size: 28px;
    font-weight: bold;
}

.nav-brand .brand-title {
    font-size: 20px;
    font-weight: 700;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot.green { background-color: var(--success-color); box-shadow: 0 0 8px var(--success-color); }
.dot.red { background-color: var(--danger-color); }
.dot.yellow { background-color: var(--warning-color); }

/* Main Layout */
.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

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

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Composer Card */
.composer-card, .preview-card {
    padding: 24px;
}

.textarea-wrapper {
    position: relative;
    margin-bottom: 16px;
}

textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 16px;
    font-family: var(--font-family);
    font-size: 16px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

textarea:focus {
    border-color: var(--primary-color);
}

.counter-container {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.35s;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary-color);
    background: rgba(29, 155, 240, 0.05);
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.browse-link {
    color: var(--primary-color);
    text-decoration: underline;
}

.dropzone-hint {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.file-input-hidden {
    display: none;
}

/* Media Preview Grid */
.media-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.preview-item {
    position: relative;
    height: 100px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.preview-item img, .preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Buttons */
.btn {
    border: none;
    border-radius: 9999px;
    font-family: var(--font-family);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

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

.btn-block {
    width: 100%;
    padding: 12px;
}

.btn-lg {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

.btn-outline-sm {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 14px;
    font-size: 13px;
}

.btn-outline-sm:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* X Tweet Card Mockup */
.x-tweet-mockup {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    background: #000;
}

.tweet-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.tweet-header .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1e2732;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.tweet-user-info {
    display: flex;
    flex-direction: column;
}

.display-name {
    font-weight: 700;
    font-size: 15px;
}

.handle {
    color: var(--text-secondary);
    font-size: 13px;
}

.tweet-body {
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 12px;
}

.tweet-media-container {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    max-height: 300px;
    display: flex;
    justify-content: center;
    background: #15181c;
}

.tweet-media-container img, .tweet-media-container video {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.tweet-footer {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 13px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* History Section */
.history-section {
    padding: 24px;
}

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

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.history-table th, .history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.history-table th {
    color: var(--text-secondary);
    font-weight: 500;
}

.source-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.source-telegram { background: rgba(0, 136, 204, 0.2); color: #0088cc; }
.source-web_ui { background: rgba(29, 155, 240, 0.2); color: #1d9bf0; }

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 24px;
}

.error-msg {
    color: var(--danger-color);
    font-size: 13px;
    margin-top: 8px;
}

.upload-progress {
    margin-top: 14px;
    display: grid;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.upload-progress.hidden {
    display: none;
}

.upload-progress-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.upload-progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1d9bf0, #65c6ff);
    transition: width 0.2s ease;
}
