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

:root {
    --primary-color: #4778df;
    --text-color: #262626;
    --text-light: #8e8e8e;
    --bg-color: #ffffff;
    --bg-light: #fafafa;
    --border-color: #dbdbdb;
    --error-color: #c62828;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

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

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

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

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

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Hero Section */
.hero {
    padding: 6rem 0;
    background-color: var(--bg-light);
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: var(--text-color);
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Features Section */
.features {
    padding: 5rem 0;
    background-color: var(--bg-color);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background-color: var(--bg-color);
    padding: 2.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.feature-description {
    color: var(--text-light);
    line-height: 1.6;
}

/* About Section */
.about {
    padding: 5rem 0;
    background-color: var(--bg-light);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
}

/* Footer */
.footer {
    background-color: var(--text-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer-text {
    color: rgba(255, 255, 255, 0.7);
}

/* Dashboard Styles */
.dashboard-hero {
    padding: 3rem 0;
    background-color: var(--bg-light);
}

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

.dashboard-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.dashboard-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
}

.dashboard-content {
    padding: 3rem 0;
    background-color: var(--bg-light);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.dashboard-card {
    background-color: var(--bg-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-icon {
    font-size: 2rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.card-body {
    padding: 1.5rem;
}

.card-description {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--bg-light);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--text-color);
}

.info-value {
    color: var(--text-light);
    word-break: break-all;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: var(--bg-light);
    border-radius: 8px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-connected {
    background-color: #4caf50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

.status-disconnected {
    background-color: var(--error-color);
    box-shadow: 0 0 8px rgba(198, 40, 40, 0.5);
}

.status-text {
    font-weight: 600;
    color: var(--text-color);
}

.instagram-account-info {
    margin-bottom: 0.75rem;
}

.instagram-account-info .account-info-text {
    font-size: 0.9rem;
    color: var(--text-light);
}

.instagram-message {
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.feature-list li {
    padding: 0.5rem 0;
    color: var(--text-light);
    line-height: 1.6;
}

.btn-block {
    width: 100%;
    text-align: center;
}

.btn-action {
    width: 100%;
    margin-bottom: 0.5rem;
    text-align: left;
    padding: 0.75rem 1rem;
}

.btn-action:last-child {
    margin-bottom: 0;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.btn:disabled:hover {
    transform: none;
    box-shadow: var(--shadow);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

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

    .btn-large {
        width: 100%;
    }

    .nav {
        gap: 1rem;
    }

    .nav-link {
        display: none;
    }

    .section-title {
        font-size: 2rem;
    }

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

    .dashboard-title {
        font-size: 2rem;
    }

    .dashboard-subtitle {
        font-size: 1rem;
    }

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

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .posts-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .posts-filter-group {
        width: 100%;
    }
}

/* Posts page */
.posts-page-card {
    overflow: visible;
}

.posts-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.posts-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.posts-filter-group label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.posts-filter-group input {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.posts-error-message {
    color: var(--error-color);
    min-height: 1.2rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.posts-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
}

.posts-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1320px;
}

.posts-table th,
.posts-table td {
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem;
    text-align: left;
    vertical-align: top;
    font-size: 0.9rem;
}

.posts-table th {
    background-color: var(--bg-light);
    white-space: nowrap;
}

.posts-row {
    height: 168px;
}

.posts-row td {
    height: 168px;
    overflow: hidden;
}

.sort-button {
    border: none;
    background-color: transparent;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
}

.sort-button:hover {
    color: var(--primary-color);
}

.post-thumb {
    width: 72px;
    height: 128px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-thumb-inner {
    width: 64px;
    height: 114px;
    background-color: #efefef;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-thumb-inner span {
    color: var(--text-light);
    font-size: 0.75rem;
}

.post-link {
    color: var(--primary-color);
    text-decoration: none;
    word-break: break-all;
}

.post-link:hover {
    text-decoration: underline;
}

.post-text-cell {
    width: 230px;
}

.post-text-preview {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.btn-readmore {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
}

.posts-empty {
    text-align: center;
    color: var(--text-light);
    padding: 1.2rem;
}

.posts-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.8rem;
}

.caption-modal {
    position: fixed;
    inset: 0;
    display: none;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.caption-modal.is-open {
    display: flex;
}

.caption-modal-content {
    width: min(760px, 100%);
    max-height: 80vh;
    overflow: hidden;
    background-color: var(--bg-color);
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
}

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

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

.caption-modal-body {
    padding: 1rem;
    max-height: calc(80vh - 56px);
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.6;
}

