/* ============================================================
   ADVERTISING MODULE STYLES
   ============================================================ */

:root {
    --ad-primary: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    --ad-primary-hover: 0 4px 12px rgba(6, 182, 212, 0.3);
    --ad-border: #e2e8f0;
    --ad-text-primary: #1e293b;
    --ad-text-secondary: #64748b;
    --ad-bg: #f8fafc;
}

/* ============================================================
   ADVERTISING SIDEBARS LAYOUT
   ============================================================ */

:root {
    --hero-height: 100vh;
    --ads-start-position: var(--hero-height);
}

.advertising-sidebars {
    pointer-events: none;
    width: 100%;
    height: auto;
}

.advertising-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 220px;
    height: calc(100vh - var(--hero-height, 100vh));
    padding: 0;
    z-index: 40;
    pointer-events: auto;
    overflow-y: auto;
    overflow-x: hidden;
    position: fixed;
    top: var(--hero-height, 100vh);
}

.advertising-sidebar::-webkit-scrollbar {
    width: 8px;
}

.advertising-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.advertising-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.advertising-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.advertising-sidebar.left {
    left: 20px;
}

.advertising-sidebar.right {
    right: 20px;
}

.advertising-sidebar.empty {
    display: none;
}

/* ============================================================
   ADVERTISEMENT CARD
   ============================================================ */

.ad-card {
    background: white;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: none;
    transition: all 0.3s ease;
    position: relative;
    animation: slideIn 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: auto;
    cursor: pointer;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ad-card {
    cursor: pointer;
}

.ad-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    border-color: #cbd5e1;
    transform: translateY(-4px);
}

.ad-card:active {
    transform: translateY(-2px);
}

.ad-card.hidden {
    display: none;
}

/* Close Button */
.ad-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #64748b;
    transition: all 0.2s ease;
    z-index: 10;
    font-weight: 600;
}

.ad-close-btn:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

.ad-close-btn:active {
    transform: scale(0.95);
}

/* Image Container */
.ad-image-container {
    width: 100%;
    height: 300px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    flex-grow: 1;
    flex-shrink: 0;
}

/* Image */
.ad-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #f1f5f9;
}

/* Content */
.ad-content {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 0;
}

.ad-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ad-text-primary);
    margin: 0;
    line-height: 1.2;
    word-break: break-word;
}

.ad-description {
    font-size: 12px;
    color: var(--ad-text-secondary);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ad-button {
    display: block;
    background: var(--ad-primary);
    color: white;
    padding: 10px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: center;
    margin-top: 8px;
    box-sizing: border-box;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

/* Large desktops (1600px and above) */
@media (min-width: 1600px) {
    .advertising-sidebars {
        grid-template-columns: 240px 1fr 240px;
    }

    .advertising-sidebar {
        width: 240px;
    }

    .ad-image {
        min-height: 350px;
    }

    .ad-title {
        font-size: 18px;
    }

    .ad-description {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }

    .ad-content {
        padding: 18px 14px;
        gap: 10px;
    }
}

/* Tablet devices (1200px - 1599px) */
@media (max-width: 1599px) and (min-width: 1200px) {
    .advertising-sidebars {
        grid-template-columns: 220px 1fr 220px;
        gap: 20px;
    }

    .advertising-sidebar {
        width: 220px;
    }
}

/* Medium tablets (1024px - 1199px) */
@media (max-width: 1199px) {
    .advertising-sidebars {
        display: none;
    }
}

/* Tablets and small screens (768px - 1023px) */
@media (max-width: 1023px) {
    .advertising-sidebars {
        display: none;
    }
}

/* Mobile devices (480px - 767px) */
@media (max-width: 767px) {
    .advertising-sidebars {
        display: none;
    }
}

/* Small mobile devices (below 480px) */
@media (max-width: 479px) {
    .advertising-sidebars {
        display: none;
    }
}

/* ============================================================
   ADMIN STYLES
   ============================================================ */

/* Module Wrapper */
.advertising-wrapper {
    width: 100%;
}

/* Header */
.advertising-header {
    margin-bottom: 32px;
}

.advertising-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--ad-text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.advertising-header p {
    font-size: 14px;
    color: var(--ad-text-secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--ad-border);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
}

.stat-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon-box.blue {
    background: #dbeafe;
}

.stat-icon-box.green {
    background: #dcfce7;
}

.stat-icon-box.gray {
    background: #f3f4f6;
}

.stat-content h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--ad-text-secondary);
    margin-bottom: 4px;
}

.stat-content p {
    font-size: 24px;
    font-weight: 700;
    color: var(--ad-text-primary);
    margin: 0;
}

/* Controls */
.controls-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.controls-left {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.btn-primary {
    background: var(--ad-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    box-shadow: var(--ad-primary-hover);
}

.search-box {
    display: flex;
    gap: 8px;
}

.search-box input {
    padding: 10px 16px;
    border: 1px solid var(--ad-border);
    border-radius: 8px;
    font-size: 14px;
    width: 250px;
}

.search-box input:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid var(--ad-border);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    color: var(--ad-text-primary);
}

.filter-select:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

/* Table Container */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--ad-border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--ad-bg);
    border-bottom: 1px solid var(--ad-border);
}

table th {
    padding: 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--ad-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    padding: 16px;
    border-bottom: 1px solid var(--ad-border);
    font-size: 14px;
    color: var(--ad-text-primary);
}

table tr:hover {
    background: var(--ad-bg);
}

/* Thumbnail in table */
.thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--ad-border);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.badge.active {
    background: #10b981;
}

.badge.inactive {
    background: #6b7280;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-view {
    background: #e0f2fe;
    color: #0369a1;
}

.btn-view:hover {
    background: #bfdbfe;
}

.btn-edit {
    background: #fef3c7;
    color: #b45309;
}

.btn-edit:hover {
    background: #fde68a;
}

.btn-toggle {
    background: #d1fae5;
    color: #065f46;
}

.btn-toggle:hover {
    background: #a7f3d0;
}

.btn-delete {
    background: #fee2e2;
    color: #991b1b;
}

.btn-delete:hover {
    background: #fecaca;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px;
    color: var(--ad-text-secondary);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--ad-text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--ad-text-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding-bottom: 24px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid var(--ad-border);
    border-radius: 4px;
    font-size: 14px;
    color: #0369a1;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: #e0f2fe;
}

.pagination span.current {
    background: var(--ad-primary);
    color: white;
    border-color: transparent;
}

/* Responsive Admin */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .controls-row {
        flex-direction: column;
    }

    .controls-left {
        flex-direction: column;
    }

    .search-box input {
        width: 100%;
    }

    .action-buttons {
        flex-direction: column;
    }

    table {
        font-size: 12px;
    }

    table th,
    table td {
        padding: 12px;
    }

    .advertising-header h1 {
        font-size: 22px;
    }
}
