/* Custom styles for Instagram Scraper */

:root {
    --primary-color: #1155cc;
    --light-color: #cfe2f3;
    --text-color: #000;
    --gradient-primary: linear-gradient(135deg, #1155cc 0%, #0d47a1 100%);
    --gradient-success: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-warning: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --custom-gradient: linear-gradient(135deg, #1155cc 0%, #4285f4 100%);
}

body {
    min-height: 100vh;
    background-color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background-color: #ffffff;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

.sidebar-brand {
    padding: 0.5rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-brand a {
    color: var(--text-color);
    font-size: 1.25rem;
}

.sidebar-brand i {
    color: var(--primary-color);
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background-color: rgba(17, 85, 204, 0.05);
    color: var(--primary-color);
}

.sidebar-link.active {
    background-color: rgba(17, 85, 204, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-link i {
    font-size: 1.1rem;
}

/* Sidebar Section Labels */
.sidebar-section-label {
    padding: 1rem 1.25rem 0.5rem;
    margin-bottom: 0.3rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7a7b7b;
    border-bottom: 2px solid #e9ecef;
    position: relative;
}

.sidebar-section-label::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 1.25rem;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
}

/* Sidebar User Info */
.sidebar-user {
    padding: 0.5rem 1.25rem 1rem;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.user-info {
    font-size: 0.9rem;
}

.user-info .fw-bold {
    color: var(--text-color);
    font-size: 0.95rem;
}

.user-info small {
    font-size: 0.75rem;
    display: block;
    margin-top: 0.125rem;
}

.user-info .btn-outline-light {
    border-color: #dee2e6;
    color: var(--primary-color);
    font-size: 0.85rem;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.user-info .btn-outline-light:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.user-info i.bi-person-circle {
    color: var(--primary-color);
}

/* Main Content with Sidebar Offset */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    padding: 2rem;
}

.main-content .container {
    max-width: 100%;
    padding: 0;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1rem;
}

/* Ensure proper alignment for flex page header */
.page-header.d-flex {
    align-items: flex-start;
}

.page-header.d-flex .btn {
    flex-shrink: 0;
    margin-top: 0.25rem;
}


/* Card improvements */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12);
}

/* Stat cards with gradients */
.card.bg-primary {
    background: var(--gradient-primary) !important;
    border: none;
}

.card.bg-success {
    background: var(--gradient-success) !important;
    border: none;
}

.card.bg-info {
    background: var(--gradient-info) !important;
    border: none;
}

.card.bg-warning {
    background: var(--gradient-warning) !important;
    border: none;
}

.card.text-white .card-title {
    font-weight: 600;
    font-size: 1rem;
    opacity: 0.95;
    margin-bottom: 1rem;
}

.card.text-white h2 {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Card headers */
.card-header {
    border: none;
    border-radius: 1rem 1rem 0 0 !important;
    font-weight: 600;
    padding: 1.25rem 1.5rem;
}

.card-header.bg-white,
.card-header.bg-white h5,
.card-header.bg-white .mb-0 {
    color: #212529 !important;
    background-color: #ffffff !important;
}

.card-header.bg-primary {
    background: var(--primary-color) !important;
    color: #ffffff !important;
}

.card-header.bg-primary h5,
.card-header.bg-primary .mb-0,
.card-header.bg-primary i {
    color: #ffffff !important;
}

.card-header.bg-secondary {
    background-color: #6c757d !important;
    color: #ffffff !important;
}

.card-header.bg-success {
    background-color: #28a745 !important;
    color: #ffffff !important;
}

.card-header.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.card-header.bg-danger {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

.card-body {
    padding: 1.5rem;
}

/* Table improvements */
.table-responsive {
    border-radius: 0.5rem;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: var(--text-color);
}

/* Progress bar improvements */
.progress {
    border-radius: 0.5rem;
    height: 1.25rem;
    background-color: rgba(0, 0, 0, 0.05);
}

.progress-bar {
    background: var(--gradient-primary);
}

/* Button improvements */
.btn {
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(17, 85, 204, 0.3);
}

.btn-primary:hover {
    background: #0d47a1;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(17, 85, 204, 0.4);
}

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

/* Form improvements */
.form-label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.form-control {
    border-radius: 0.5rem;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(17, 85, 204, 0.15);
}

.form-text {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Badge improvements */
.badge {
    padding: 0.5em 0.85em;
    font-weight: 600;
    border-radius: 0.375rem;
}

/* Modal improvements */
.modal-content {
    border: none;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.modal-body h6 {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Loading animation for htmx */
.htmx-request {
    opacity: 0.6;
    transition: opacity 200ms ease-in;
}

/* Status indicators */
.border-warning {
    border-left: 4px solid #ffc107 !important;
}

.border-success {
    border-left: 4px solid #28a745 !important;
}

.border-danger {
    border-left: 4px solid #dc3545 !important;
}

.border-secondary {
    border-left: 4px solid #6c757d !important;
}

/* Icon improvements */
.bi {
    vertical-align: -0.125em;
}

/* Action icon buttons */
.action-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.action-icon-view {
    color: var(--primary-color);
}

.action-icon-view:hover {
    background-color: rgba(17, 85, 204, 0.1);
    color: var(--primary-color);
}

.action-icon-delete {
    color: #dc3545;
}

.action-icon-delete:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Page header */
h1 {
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

h5 {
    font-weight: 600;
}

/* Smooth transitions */
.card, .btn, .form-control, .nav-link {
    transition: all 0.3s ease;
}

/* Ensure modal alerts stay visible */
.modal-body .alert {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    animation: none !important;
    transition: none !important;
}

/* Nested tabs styling */
.nav-tabs-sm {
    border-bottom: 1px solid #dee2e6;
}

.nav-tabs-sm .nav-link {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .card.text-white h2 {
        font-size: 2rem;
    }

    .sidebar {
        width: 220px;
    }

    .main-content {
        margin-left: 220px;
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
}

/* Dashboard Platform Cards */
.platform-card {
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.platform-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15) !important;
}

.platform-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.stats-row {
    display: flex;
    justify-content: space-around;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.1);
}

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

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1155cc;
}

.stat-label {
    font-size: 0.875rem;
    color: #6c757d;
}

.stat-link {
    text-decoration: none;
    transition: all 0.2s ease;
    display: block;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
}

.stat-link:hover {
    background-color: rgba(17, 85, 204, 0.08);
    transform: scale(1.02);
}

.stat-link:hover .stat-value {
    color: #0d47a1;
}

.stat-link:hover .stat-label {
    color: #1155cc;
}

/* Login/Signup Page Styles */
.auth-page {
    background: linear-gradient(135deg, #1155cc 0%, #4285f4 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card,
.signup-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 100%;
}
