/* Multi-Platform Ad Management System - Main Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

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

html {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    min-height: 100%;
}

/* Navbar Styles */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    height: 100%;
    width: 100%;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    background: #667eea;
    background: -moz-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: -webkit-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    background: white;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
    padding: 2.5rem;
    margin: auto;
    flex-shrink: 0;
}

.auth-card h2 {
    margin-bottom: 1.5rem;
    color: #333;
    font-weight: 600;
}

.auth-card .form-control {
    padding: 0.75rem;
    border-radius: 8px;
}

.auth-card .btn {
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
}

/* Dashboard Cards */
.dashboard-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
}

.stat-card {
    padding: 1.5rem;
    background: white;
    border-left: 4px solid var(--primary-color);
}

.stat-card.success {
    border-left-color: var(--success-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.danger {
    border-left-color: var(--danger-color);
}

.stat-card.info {
    border-left-color: var(--info-color);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.table {
    margin-bottom: 0;
}

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

/* Status Badges */
.badge {
    padding: 0.4rem 0.8rem;
    font-weight: 500;
    font-size: 0.75rem;
}

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,.15);
}

/* Form Styles */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 0.625rem 0.875rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Modal Styles */
.modal-content {
    border-radius: 10px;
    border: none;
}

.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 10px 10px 0 0;
}

.modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 10px 10px;
}

/* Sidebar */
.sidebar {
    min-height: calc(100vh - 56px);
    background-color: #fff;
    border-right: 1px solid #dee2e6;
    padding: 1.5rem 0;
}

.sidebar .nav-link {
    color: #495057;
    padding: 0.75rem 1.5rem;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar .nav-link.active {
    background-color: #e7f1ff;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 20px;
}

/* Content Area */
.content-area {
    padding: 2rem;
}

/* Card */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    padding: 1rem 1.5rem;
}

/* Image Upload Preview */
.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.image-preview-item {
    position: relative;
    width: 150px;
    height: 150px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pricing Table */
.pricing-table {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.pricing-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #dee2e6;
}

.pricing-row:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        min-height: 0;
    }

    .content-area {
        padding: 1rem;
    }

    .auth-container {
        padding: 0.5rem;
    }

    .auth-card {
        padding: 1.5rem;
        max-width: 100%;
    }

    .stat-number {
        font-size: 1.5rem;
    }
}

/* Utilities */
.text-muted-custom {
    color: #6c757d !important;
}

.border-start-primary {
    border-left: 4px solid var(--primary-color) !important;
}

.border-start-success {
    border-left: 4px solid var(--success-color) !important;
}

.border-start-warning {
    border-left: 4px solid var(--warning-color) !important;
}

.border-start-danger {
    border-left: 4px solid var(--danger-color) !important;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Mobile-First: Reduced White Spaces & Compact Design */
body {
    font-size: 0.95rem;
}

.content-area {
    padding: 1rem !important;
}

.card-header {
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem !important;
}

.card-body {
    padding: 0.875rem !important;
}

.stat-card {
    padding: 1rem !important;
}

.stat-number {
    font-size: 1.5rem !important;
}

.stat-label {
    font-size: 0.8rem !important;
}

.table-container {
    padding: 0.875rem !important;
}

.table {
    font-size: 0.875rem !important;
}

.table thead th {
    padding: 0.5rem !important;
    font-size: 0.8rem !important;
}

.table tbody td {
    padding: 0.5rem !important;
}

.btn {
    padding: 0.4rem 1rem !important;
    font-size: 0.875rem !important;
}

.btn-sm {
    padding: 0.25rem 0.65rem !important;
    font-size: 0.8rem !important;
}

.badge {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.7rem !important;
}

.form-label {
    margin-bottom: 0.375rem !important;
    font-size: 0.9rem !important;
}

.form-control, .form-select {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.9rem !important;
}

.mb-3 {
    margin-bottom: 0.75rem !important;
}

.mb-4 {
    margin-bottom: 1rem !important;
}

.modal-header, .modal-footer {
    padding: 0.75rem 1rem !important;
}

.modal-body {
    padding: 0.875rem !important;
}

.sidebar .nav-link {
    padding: 0.6rem 1.25rem !important;
    font-size: 0.9rem !important;
}

h2, .h2 {
    font-size: 1.5rem !important;
}

h3, .h3 {
    font-size: 1.25rem !important;
}

h4, .h4 {
    font-size: 1.1rem !important;
}

h5, .h5 {
    font-size: 1rem !important;
}

.alert {
    padding: 0.6rem 0.875rem !important;
    font-size: 0.9rem !important;
}

/* Extra Mobile Optimization */
@media (max-width: 768px) {
    .content-area {
        padding: 0.75rem !important;
    }

    .card-header {
        padding: 0.6rem 0.875rem !important;
        font-size: 0.9rem !important;
    }

    .card-body {
        padding: 0.75rem !important;
    }

    .table {
        font-size: 0.8rem !important;
    }

    .table thead th, .table tbody td {
        padding: 0.4rem !important;
    }

    h2, .h2 {
        font-size: 1.25rem !important;
    }

    .btn {
        padding: 0.375rem 0.85rem !important;
    }

    .stat-number {
        font-size: 1.25rem !important;
    }
}

/* Highlight Submit New Ad button in navbar on all pages */
.navbar-nav .nav-link[href*="submit-ad.php"] {
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 6px !important;
    padding: 0.5rem 1rem !important;
    font-weight: 600 !important;
}
