/* Easy LinkedIn Share - Modern UI */

/* CSS Variables - Light Mode */
:root {
    --primary: #0a66c2;
    --primary-dark: #004182;
    --primary-light: #70b5f9;
    --secondary: #666;
    --success: #057642;
    --success-bg: #e6f4ea;
    --danger: #cc1016;
    --danger-bg: #fce8e6;
    --warning: #f5c75d;
    --warning-bg: #fef3c7;
    --info: #0288d1;
    --info-bg: #e3f2fd;

    --bg: #f3f2ef;
    --bg-secondary: #ffffff;
    --card-bg: #ffffff;
    --text: #191919;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border: #e0e0e0;
    --border-light: #f0f0f0;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.15);

    --transition: all 0.2s ease;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    /* Gemini gradient */
    --gradient-ai: linear-gradient(135deg, #4285f4 0%, #ea4335 25%, #fbbc04 50%, #34a853 75%, #4285f4 100%);
    --gradient-ai-hover: linear-gradient(135deg, #3367d6 0%, #d33828 25%, #f9a825 50%, #2e7d32 75%, #3367d6 100%);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1a1a;
        --bg-secondary: #242424;
        --card-bg: #2d2d2d;
        --text: #ffffff;
        --text-secondary: #b0b0b0;
        --text-muted: #808080;
        --border: #404040;
        --border-light: #333333;
        --shadow: 0 2px 8px rgba(0,0,0,0.3);
        --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Navbar */
.navbar {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-brand i {
    font-size: 1.75rem;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.625rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    background: var(--bg);
    color: var(--text);
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-user img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
}

.nav-user-name {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

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

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

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

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

.btn-secondary:hover {
    background: var(--border-light);
}

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

.btn-danger:hover {
    background: #a00;
}

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

.btn-ai {
    background: var(--gradient-ai);
    background-size: 300% 300%;
    color: white;
    animation: gradient-shift 3s ease infinite;
}

.btn-ai:hover {
    background: var(--gradient-ai-hover);
    background-size: 300% 300%;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary { background: var(--info-bg); color: var(--info); }
.stat-icon.success { background: var(--success-bg); color: var(--success); }
.stat-icon.warning { background: var(--warning-bg); color: #b45309; }
.stat-icon.danger { background: var(--danger-bg); color: var(--danger); }

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.form-group small a {
    color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Character count */
.char-count {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.char-count.warning {
    color: var(--warning);
}

.char-count.danger {
    color: var(--danger);
}

/* AI Toolbar */
.ai-toolbar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff8f8 50%, #fffff8 100%);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

@media (prefers-color-scheme: dark) {
    .ai-toolbar {
        background: linear-gradient(135deg, #1a1a2e 0%, #2a1a1a 50%, #2a2a1a 100%);
    }
}

.ai-toolbar-title {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.ai-toolbar-title i {
    background: var(--gradient-ai);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Posts */
.posts-section h2 {
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.post-card:hover {
    box-shadow: var(--shadow-hover);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.post-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-posted { background: var(--success-bg); color: var(--success); }
.status-scheduled { background: var(--info-bg); color: var(--info); }
.status-draft { background: var(--bg); color: var(--secondary); }
.status-failed { background: var(--danger-bg); color: var(--danger); }

.post-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.post-content {
    margin-bottom: 1rem;
    white-space: pre-wrap;
    line-height: 1.7;
}

.post-media {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    width: fit-content;
}

.post-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

/* Compose Page */
.compose-page {
    max-width: 800px;
    margin: 0 auto;
}

.post-form {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

/* Media Section */
.media-section {
    margin-bottom: 1.5rem;
}

.media-section h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.media-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.media-tab {
    padding: 0.625rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.media-tab:hover {
    border-color: var(--primary-light);
    color: var(--text);
}

.media-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.media-upload,
.link-input {
    padding: 1.5rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}

.upload-zone {
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-zone:hover,
.upload-zone.dragover {
    background: var(--card-bg);
    border-color: var(--primary);
}

.upload-zone i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-zone p {
    color: var(--text-secondary);
    font-weight: 500;
}

.upload-preview {
    text-align: center;
}

.upload-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.video-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.video-preview i {
    font-size: 2rem;
    color: var(--primary);
}

/* Schedule Section */
.schedule-section {
    margin-bottom: 1.5rem;
}

.schedule-section h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.schedule-options {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.schedule-picker {
    margin-top: 1rem;
}

.schedule-picker input {
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text);
}

/* Settings Page */
.settings-page h1 {
    margin-bottom: 2rem;
}

.settings-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.settings-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.settings-section h2 i {
    color: var(--primary);
}

.section-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.settings-form {
    max-width: 500px;
}

.auth-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.auth-section h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.auth-connected {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--success-bg);
    border-radius: var(--radius);
}

.profile-pic {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: var(--shadow);
}

.auth-info {
    flex: 1;
}

.auth-name {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
}

.auth-status-text {
    color: var(--success);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.auth-disconnected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    background: var(--danger-bg);
    border-radius: var(--radius);
}

.status-ok {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--success);
    padding: 1rem;
    background: var(--success-bg);
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    font-weight: 500;
}

.status-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #b45309;
    padding: 1rem;
    background: var(--warning-bg);
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    font-weight: 500;
}

/* AI Provider Toggle */
.provider-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.provider-option {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.provider-option:hover {
    border-color: var(--primary-light);
}

.provider-option.active {
    border-color: var(--primary);
    background: rgba(10, 102, 194, 0.05);
}

.provider-option i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.provider-option .provider-name {
    font-weight: 600;
    display: block;
}

.provider-option .provider-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Scheduled Page */
.scheduled-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.scheduled-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.scheduled-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.scheduled-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary);
}

.time-until {
    background: var(--info-bg);
    color: var(--info);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.scheduled-content {
    margin-bottom: 1rem;
    white-space: pre-wrap;
    line-height: 1.7;
}

.scheduled-media {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.scheduled-actions {
    display: flex;
    gap: 0.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

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

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

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    background: var(--text);
    color: white;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }
.toast.warning { background: #b45309; }

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

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

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

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--card-bg);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow);
    }

    .nav-links.show {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .container {
        padding: 1.5rem 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .ai-toolbar {
        flex-direction: column;
    }

    .ai-toolbar .btn {
        width: 100%;
    }

    .schedule-options {
        flex-direction: column;
        gap: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .post-header {
        flex-direction: column;
    }

    .media-tabs {
        flex-wrap: wrap;
    }

    .media-tab {
        flex: 1 1 calc(50% - 0.25rem);
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .toast,
    .modal {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .card,
    .post-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
