/* Admin Dashboard Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f8f9fa;
    color: #333;
}

/* Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.login-header p {
    color: #666;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 1rem;
    text-align: center;
}

/* Admin Dashboard */
.admin-dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-nav {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e1e5e9;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-header h2 {
    color: #333;
    margin: 0;
}

.admin-content {
    display: flex;
    flex: 1;
}

.admin-sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid #e1e5e9;
    padding: 2rem 0;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: #f8f9fa;
    color: #667eea;
    border-right: 3px solid #667eea;
}

.sidebar-link i {
    margin-right: 12px;
    width: 20px;
}

.admin-main {
    flex: 1;
    padding: 2rem;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e1e5e9;
}

.section-header h1 {
    color: #333;
    margin: 0;
}

.section-filters select {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    background: white;
    color: #333;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-content h3 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-change.positive {
    color: #27ae60;
}

.stat-change.negative {
    color: #e74c3c;
}

.stat-change.neutral {
    color: #f39c12;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.dashboard-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.dashboard-card h3 {
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e1e5e9;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.activity-item i {
    color: #667eea;
    margin-top: 0.25rem;
}

.activity-content p {
    margin-bottom: 0.25rem;
    color: #333;
}

.activity-time {
    font-size: 0.9rem;
    color: #666;
}

/* Popular Posts */
.popular-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.post-item h4 {
    color: #333;
    margin-bottom: 0.5rem;
}

.post-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.post-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Tables */
.posts-table-container,
.subscriptions-table-container,
.payments-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.posts-table,
.subscriptions-table,
.payments-table {
    width: 100%;
    border-collapse: collapse;
}

.posts-table th,
.subscriptions-table th,
.payments-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e1e5e9;
}

.posts-table td,
.subscriptions-table td,
.payments-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f3f4;
}

.posts-table tr:hover,
.subscriptions-table tr:hover,
.payments-table tr:hover {
    background: #f8f9fa;
}

/* Badges */
.category-badge,
.plan-badge,
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.category-badge.short {
    background: #e3f2fd;
    color: #1976d2;
}

.category-badge.long {
    background: #f3e5f5;
    color: #7b1fa2;
}

.category-badge.premium {
    background: #fff3e0;
    color: #f57c00;
}

.plan-badge.free {
    background: #e8f5e8;
    color: #2e7d32;
}

.plan-badge.premium {
    background: #fff3e0;
    color: #f57c00;
}

.status-badge.published,
.status-badge.active,
.status-badge.success {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-badge.draft,
.status-badge.inactive {
    background: #fafafa;
    color: #757575;
}

.status-badge.failed {
    background: #ffebee;
    color: #c62828;
}

/* Action Buttons */
.btn-icon {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.3s ease;
    margin: 0 2px;
}

.btn-icon:hover {
    background: #f8f9fa;
    color: #333;
}

/* Analytics */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.analytics-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.analytics-card h3 {
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e1e5e9;
}

.chart-placeholder {
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

.chart-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.referrers-list,
.device-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.referrer-item,
.device-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.referrer-item span:first-child,
.device-item span:first-child {
    color: #333;
    font-weight: 500;
}

.referrer-item span:last-child,
.device-item span:last-child {
    color: #667eea;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-content {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e1e5e9;
    }

    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 0 1rem;
    }

    .sidebar-menu li {
        margin-right: 1rem;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .sidebar-link {
        padding: 8px 16px;
        border-right: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }

    .sidebar-link.active {
        border-right: none;
        border-bottom-color: #667eea;
    }

    .admin-main {
        padding: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .posts-table-container,
    .subscriptions-table-container,
    .payments-table-container {
        overflow-x: auto;
    }

    .posts-table,
    .subscriptions-table,
    .payments-table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .login-container {
        margin: 1rem;
        padding: 2rem;
    }

    .nav-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .activity-item {
        flex-direction: column;
        text-align: center;
    }
}
