/* The Pitch Pack Dashboard - Main Stylesheet */

/* Global Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fafafa;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: #374151;
}

/* Common Header Styles */
.header {
    background: white;
    color: #1f2937;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

/* Navigation Styles */
.nav-links {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.nav-link {
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.nav-link:hover {
    color: #374151;
    background: #f3f4f6;
}

.nav-link.active {
    color: #10b981;
    background: #ecfdf5;
}

/* Dropdown Navigation */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-toggle {
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.nav-dropdown-toggle:hover {
    color: #374151;
    background: #f3f4f6;
}

.nav-dropdown-toggle.active {
    color: #10b981;
    background: #ecfdf5;
}

.nav-dropdown-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.nav-dropdown.open .nav-dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 0.5rem;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

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

.nav-dropdown-item:hover {
    background: #f8fafc;
    color: #374151;
    padding-left: 1.25rem;
}

.nav-dropdown-item.active {
    background: #ecfdf5;
    color: #10b981;
    border-left: 3px solid #10b981;
}

/* Container and Layout */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem;
    min-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}

/* Page Titles */
.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

/* Common Cards and Sections */
.section-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.25rem;
    color: #1f2937;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

/* Loading and Error States */
.loading {
    text-align: center;
    color: #6b7280;
    font-size: 1rem;
    font-weight: 500;
    margin: 2rem 0;
    padding: 2rem;
}

.error {
    background: #fef2f2;
    color: #dc2626;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    border: 1px solid #fecaca;
    font-weight: 500;
}

/* Utility Classes */
.hidden {
    display: none;
}

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

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

/* Common Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
    color: #374151;
    transform: translateY(-1px);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

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

/* Form Elements */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.form-input:focus {
    outline: none;
    border-color: #10b981;
    background: white;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.875rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
    /* margin-top: 1.5rem; */
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th {
    background: #f9fafb;
    color: #374151;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    font-weight: 500;
}

tbody tr:hover {
    background: #f9fafb;
}

tbody tr:nth-child(even) {
    background: #fafafa;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}

.status-active {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #10b981;
}

.status-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

/* Debug Banner */
.debug-banner {
    background: #dc2626;
    color: white;
    text-align: center;
    padding: 8px;
    font-weight: bold;
    font-size: 14px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.debug-banner-spacer {
    height: 40px;
}

/* Announcement Banner */
.announcement-banner {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 12px 16px;
    font-weight: 500;
    font-size: 14px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.announcement-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    text-align: center;
}

.announcement-banner-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.announcement-banner-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0.8;
    flex-shrink: 0;
}

.announcement-banner-close:hover {
    background: rgba(255, 255, 255, 0.15);
    opacity: 1;
}

.announcement-banner-close:active {
    background: rgba(255, 255, 255, 0.25);
}

.announcement-banner-spacer {
    height: 48px;
}

/* When both debug and announcement banners are present */
.has-debug-banner .announcement-banner {
    top: 40px;
}

.has-both-banners-spacer {
    height: 88px;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .nav-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .section-card {
        padding: 1rem;
    }
    
    .btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-link {
        text-align: center;
        width: 100%;
    }
}

/* ============================================================
   NOTIFICATION SYSTEM STYLES
   ============================================================ */

.notification-container {
    position: relative;
    display: inline-block;
}

.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 500px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 1000;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.notification-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.mark-all-read-btn {
    background: none;
    border: none;
    color: #10b981;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.mark-all-read-btn:hover {
    background: #ecfdf5;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.notification-item:hover {
    background: #f9fafb;
}

.notification-item.unread {
    background: #eff6ff;
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #3b82f6;
}

.notification-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1f2937;
    margin: 0;
}

.notification-message {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

.notification-time {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.notification-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: #9ca3af;
}

.notification-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Toast Container - Top Middle of Screen */
.notification-toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    width: 100%;
    max-width: 500px;
    padding: 0 20px;
}

/* Individual Toast Notification */
.notification-toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border-left: 4px solid #10b981;
}

.notification-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.notification-toast:hover {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* Toast Colors by Type */
.notification-toast.order {
    border-left-color: #10b981;
}

.notification-toast.payout {
    border-left-color: #3b82f6;
}

.notification-toast.campaign_match {
    border-left-color: #f59e0b;
}

.notification-toast.admin_message {
    border-left-color: #8b5cf6;
}

.notification-toast.system {
    border-left-color: #6b7280;
}

.notification-toast.info-toast {
    border-left-color: #06b6d4;
}

/* Toast Content Layout */
.notification-toast-content {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
}

.notification-toast-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: #f3f4f6;
    color: #6b7280;
}

.notification-toast.order .notification-toast-icon {
    background: #d1fae5;
    color: #059669;
}

.notification-toast.payout .notification-toast-icon {
    background: #dbeafe;
    color: #2563eb;
}

.notification-toast.campaign_match .notification-toast-icon {
    background: #fef3c7;
    color: #d97706;
}

.notification-toast.admin_message .notification-toast-icon {
    background: #f3e8ff;
    color: #7c3aed;
}

.notification-toast.system .notification-toast-icon {
    background: #f3f4f6;
    color: #4b5563;
}

.notification-toast.info-toast .notification-toast-icon {
    background: #cffafe;
    color: #0891b2;
}

.notification-toast-body {
    flex: 1;
    min-width: 0;
}

.notification-toast-title {
    font-weight: 600;
    font-size: 15px;
    color: #111827;
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.notification-toast-message {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.notification-toast-time {
    display: inline-block;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 6px;
}

.notification-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-toast-close:hover {
    background: #f3f4f6;
    color: #4b5563;
}

/* Global System Toast (for admin messages like "saved", "updated", etc.) */
.system-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10002;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 350px;
    max-width: 500px;
    opacity: 0;
    transform: translate(-50%, -20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.system-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

.system-toast.success {
    border-left: 4px solid #10b981;
}

.system-toast.error {
    border-left: 4px solid #ef4444;
}

.system-toast.info {
    border-left: 4px solid #3b82f6;
}

.system-toast.warning {
    border-left: 4px solid #f59e0b;
}

.system-toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.system-toast.success .system-toast-icon {
    background: #d1fae5;
    color: #059669;
}

.system-toast.error .system-toast-icon {
    background: #fee2e2;
    color: #dc2626;
}

.system-toast.info .system-toast-icon {
    background: #dbeafe;
    color: #2563eb;
}

.system-toast.warning .system-toast-icon {
    background: #fef3c7;
    color: #d97706;
}

.system-toast-message {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #111827;
}