/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1DA1F2;
    --secondary-color: #14171A;
    --background-color: #000000;
    --surface-color: #0f0f0f;
    --text-primary: #E7E9EA;
    --text-secondary: #71767B;
    --border-color: #2F3336;
    --twitter-color: #1DA1F2;
    --linkedin-color: #0077B5;
    --instagram-color: #E4405F;
    --tiktok-color: #000000;
    --success-color: #00BA7C;
    --danger-color: #F4212E;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    overflow-x: hidden;
    touch-action: pan-y;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
}

.app-header h1 {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #1DA1F2, #E4405F);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.add-account-btn,
.refresh-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.refresh-btn.spinning {
    animation: spin 1s linear infinite;
}

.add-account-btn:active,
.refresh-btn:active {
    transform: scale(0.95);
}

/* Accounts Bar */
.accounts-bar {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    height: 56px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    z-index: 90;
}

.accounts-bar::-webkit-scrollbar {
    display: none;
}

.account-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.account-pill.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.account-pill i {
    font-size: 16px;
}

.account-pill span {
    font-size: 14px;
    font-weight: 500;
}

.account-pill .remove-btn {
    margin-left: 4px;
    padding: 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
}

.account-pill:hover .remove-btn {
    display: block;
}

/* Feed Container */
.feed-container {
    margin-top: 116px;
    padding-bottom: 20px;
    min-height: calc(100vh - 116px);
}

.feed-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Feed Card */
.feed-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.feed-card:active {
    transform: scale(0.98);
}

.feed-header {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.feed-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.feed-info {
    flex: 1;
}

.feed-name {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.feed-username {
    font-size: 14px;
    color: var(--text-secondary);
}

.platform-badge {
    font-size: 16px;
    opacity: 0.8;
}

.feed-content {
    padding: 0 16px 16px;
}

.feed-text {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 12px;
    white-space: pre-wrap;
}

.feed-media {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 12px;
}

.feed-media img,
.feed-media video {
    width: 100%;
    height: auto;
    display: block;
}

.feed-actions {
    display: flex;
    justify-content: space-around;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.action-btn:active {
    background-color: rgba(255, 255, 255, 0.1);
}

.action-btn i {
    font-size: 18px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--surface-color);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 20px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

.platform-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.platform-btn {
    background-color: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.platform-btn.active {
    border-color: var(--primary-color);
    background-color: rgba(29, 161, 242, 0.1);
}

.platform-btn i {
    font-size: 28px;
}

.platform-btn span {
    font-size: 14px;
    font-weight: 500;
}

.username-input {
    width: 100%;
    padding: 16px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 20px;
}

.username-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.add-btn {
    width: 100%;
    padding: 16px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-btn:active {
    transform: scale(0.98);
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.loading-spinner.active {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Empty State */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    margin-top: 60px;
}

.empty-state.active {
    display: flex;
}

.empty-state i {
    font-size: 64px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.empty-state h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
}

/* Platform Colors */
.twitter { color: var(--twitter-color); }
.linkedin { color: var(--linkedin-color); }
.instagram { color: var(--instagram-color); }
.tiktok { color: var(--tiktok-color); border: 1px solid white; border-radius: 50%; padding: 2px; }

/* Responsive */
@media (max-width: 480px) {
    .app-header {
        padding: 0 16px;
    }
    
    .accounts-bar {
        padding: 0 16px;
    }
    
    .feed-wrapper {
        padding: 0 16px;
    }
    
    .platform-selector {
        grid-template-columns: 1fr;
    }
}

/* Touch feedback */
@media (hover: none) {
    .feed-card:active {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1001;
    max-width: 90vw;
}

.notification-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

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

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

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

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-icon {
    font-size: 20px;
}

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

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

.notification-toast.info .notification-icon {
    color: var(--primary-color);
}

.notification-message {
    font-size: 14px;
    color: var(--text-primary);
}