/* style.css */
/*
Theme Name: Kadence Child
Theme URI: https://www.kadencewp.com/kadence-theme/
Template: kadence
Author: Your Name
Author URI: https://yoursite.com
Description: Child theme for Kadence
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kadence-child
*/

/* Main container */
.page-template-page-campaign-administration .site-header {
    height: auto;
    min-height: 160px; /* Adjust this value to match your logo height */
}

#discount-value-container {
    display: flex;
    flex-direction: column;
}

#discount-value-container input {
    margin-top: 5px; /* Add some spacing between label and input */
}

#discount-value-container span {
    display: inline-block;
    margin-left: 5px; /* Keep the % suffix next to the input */
}

/* Header bar positioning */
.campaign-header-bar {
    position: fixed;
    top: 165px;
    left: 0;
    right: 0;
    background: white;
    z-index: 1000;
    padding: 15px 40px;
    border-bottom: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.campaign-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    width: 100%;
}

.campaign-table-header,
.campaign-admin-table {
    table-layout: fixed;
    border-collapse: collapse;
    width: 100%;
}

.campaign-table-header th,
.campaign-admin-table td {
    padding: 12px 16px;
    text-align: left;
    vertical-align: middle;
    box-sizing: border-box;
}

/* Status filter */
.status-filter {
    min-width: 200px;
}

.status-filter select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Main table container */
.table-container {
    margin-top: 310px; /* Adjust based on header height */
    padding: 0 40px;
    overflow-y: auto;
    max-height: calc(100vh - 310px);
}

/* Main table styles */
.campaign-admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.campaign-admin-table td {
    padding: 8px 20px;
    border: 1px solid #ddd;
    text-align: left;
}

/* Column widths - matching for header and body */
.campaign-table-header th:nth-child(1),
.campaign-admin-table td:nth-child(1) {
    width: 80px;  /* Campaign ID */
}

.campaign-table-header th:nth-child(2),
.campaign-admin-table td:nth-child(2) {
    width: 250px; /* Business Name */
}

.campaign-table-header th:nth-child(3),
.campaign-admin-table td:nth-child(3) {
    width: 120px; /* Start Date */
}

.campaign-table-header th:nth-child(4),
.campaign-admin-table td:nth-child(4) {
    width: 100px; /* Post Code */
}

.campaign-table-header th:nth-child(5),
.campaign-admin-table td:nth-child(5) {
    width: 100px; /* Country (new column) */
}

.campaign-table-header th:nth-child(6),
.campaign-admin-table td:nth-child(6) {
    width: 80px;  /* Users */
}

.campaign-table-header th:nth-child(7),
.campaign-admin-table td:nth-child(7) {
    width: 120px; /* Status */
}

.campaign-table-header th:nth-child(8),
.campaign-admin-table td:nth-child(8) {
    width: 50px;  /* Button */
}

/* Status badge styles */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    display: inline-block;
}

.status-pending_approval {
    background-color: #fff3cd;
    color: #856404;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.status-cancelled {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 5px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.modal-close {
    position: absolute;
    right: 10px;
    top: 10px;
    cursor: pointer;
    font-size: 20px;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 4px;
    z-index: 2100;
    animation: fadeIn 0.3s ease-in;
}

.notification.success {
    background-color: #d4edda;
    color: #155724;
}

.notification.error {
    background-color: #f8d7da;
    color: #721c24;
}

.notification.info {
    background-color: #cce5ff;
    color: #004085;
}

.campaign-actions {
    display: none; /* Hidden by default */
    margin-top: 20px;
    gap: 12px;
}

tr[data-status="pending_approval"] .campaign-actions {
    display: flex !important;
}

/* Campaign details styles */
.campaign-details-row[data-status="pending_approval"] .campaign-actions {
    display: flex;
    margin-top: 20px;
    gap: 12px;
}

.campaign-details-content {
    padding: 20px;
}

.campaign-details-content h3 {
    margin-bottom: 20px; /* Increased space after the heading */
    font-size: 18px;
    font-weight: 600;
}

.details-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    margin-bottom: 12px; /* Space between rows */
}

.detail-row .label {
    width: 200px; /* Fixed width for label */
    padding-right: 36px; /* Space between key and value */
    font-weight: 600;
    color: #555;
    flex-shrink: 0; /* Prevent the label from shrinking */
}

.detail-row .value {
    flex-grow: 1; /* Allow the value to take remaining space */
    word-break: break-word; /* Allows long values to wrap properly */
}

/* Map and Flyer container styles */
.details-bottom-section {
    margin-top: 30px; /* Increased space before the map/flyer section */
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.details-bottom-section h3 {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.map-container, 
.flyer-container {
    flex: 1;
    min-width: 300px;
}

.campaign-map {
    height: 300px;
    width: 100%;
}

/* Button styles */


.campaign-actions.show {
    display: flex;
    gap: 12px;
}


.approve-button, .reject-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.approve-button {
    background-color: #28a745;
    color: white;
}

.reject-button {
    background-color: #dc3545;
    color: white;
}

.approve-button:hover {
    background-color: #218838;
}

.reject-button:hover {
    background-color: #c82333;
}

/* Fix toggle details display */
.expand-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    color: #666;
}

.expand-button:hover {
    color: #333;
}

/* Make sure maps container is visible */
.campaign-map {
    min-height: 300px;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.admin-navigation {
    padding: 16px 40px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.admin-nav-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.admin-nav-link:hover {
    text-decoration: underline;
}

/* Coupon Management Styles */
.coupon-list-container {
    margin-top: 20px;
}

.tablenav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
}

.status-active {
    color: green;
    font-weight: bold;
}

.status-inactive {
    color: red;
}

/* Modal Styles */
.coupon-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.coupon-modal-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 4px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
}

.form-field {
    margin-bottom: 15px;
}

.form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-field input,
.form-field select,
.form-field textarea {
   width: 100%;
   padding: 8px;
   border: 1px solid #ddd;
   border-radius: 4px;
}

.form-actions {
   margin-top: 20px;
   text-align: right;
}

#value-suffix {
   margin-left: 5px;
}

#discount-value-field {
   display: flex;
   align-items: center;
}

.coupon-modal h2 {
   margin-top: 0;
   border-bottom: 1px solid #eee;
   padding-bottom: 10px;
}

/* My Campaigns Page Styles */
.my-campaigns-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.campaign-header {
    margin-bottom: 30px;
}

.campaign-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.campaign-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Error Message */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

/* No Campaigns Message */
#no-campaigns-message {
    padding: 30px;
    background-color: #f9f9f9;
    border-radius: 4px;
    text-align: center;
    margin: 20px 0;
}

#no-campaigns-message a {
    color: #007bff;
    font-weight: 500;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 0;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #007bff;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Campaign Row Hover Effect */
.campaign-row:hover {
    background-color: #f5f7fa;
}

/* Campaign Table */
.campaign-table-container {
    overflow-x: auto;
    margin-bottom: 30px;
}

.my-campaigns-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.my-campaigns-table th,
.my-campaigns-table td {
    padding: 12px 16px;
    text-align: left;
    border: 1px solid #e3e6f0;
}

.my-campaigns-table th {
    background-color: #f8f9fc;
    color: #4e73df;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.my-campaigns-table tr:nth-child(even) {
    background-color: #f8f9fc;
}

/* Toggle Button */
.toggle-details-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    color: #4e73df;
    transition: all 0.2s;
    border-radius: 4px;
}

.toggle-details-btn:hover {
    background-color: #eef0f8;
    color: #2e59d9;
}

/* Campaign Details Row */
.campaign-details-row {
    background-color: #f8f9fc !important;
}

.campaign-details-content {
    padding: 20px;
    background-color: #f8f9fc;
    border-radius: 4px;
}

.campaign-details-content h3 {
    margin-bottom: 15px;
    color: #4e73df;
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 1px solid #e3e6f0;
    padding-bottom: 8px;
}

/* Status Badge Styling */
.status-badge {
    padding: 5px 10px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    text-align: center;
    min-width: 100px;
}

.status-pending_approval {
    background-color: #fff3cd;
    color: #856404;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.status-cancelled {
    background-color: #e2e3e5;
    color: #383d41;
}

.status-payment_pending {
    background-color: #cce5ff;
    color: #004085;
}

/* Details Grid */
.details-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 25px;
}

.detail-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    align-items: center;
}

.detail-row .label {
    font-weight: 600;
    color: #5a5c69;
}

.detail-row .value {
    color: #333;
}

/* Map and Flyer Section */
.details-bottom-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 25px 0;
}

.map-container, 
.flyer-container {
    background-color: #fff;
    border-radius: 4px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.campaign-map {
    height: 300px;
    width: 100%;
    border: 1px solid #e3e6f0;
    border-radius: 4px;
    background-color: #f8f9fc;
}

.flyer-preview {
    min-height: 300px;
    max-height: 400px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fc;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e3e6f0;
}

.flyer-preview img,
.flyer-preview embed {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.hidden {
  display: none !important;
}

/* Campaign Actions */
.campaign-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #e3e6f0;
    padding-top: 15px;
}

.view-summary-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: #4e73df;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.view-summary-button:hover {
    background-color: #2e59d9;
    text-decoration: none;
    color: white;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .detail-row {
        grid-template-columns: 150px 1fr;
    }
}

@media (max-width: 768px) {
    .details-bottom-section {
        grid-template-columns: 1fr;
    }
    
    .my-campaigns-table {
        font-size: 14px;
    }
    
    .my-campaigns-table th,
    .my-campaigns-table td {
        padding: 8px 10px;
    }
    
    /* Hide less important columns on mobile */
    .my-campaigns-table th:nth-child(3),
    .my-campaigns-table td:nth-child(3),
    .my-campaigns-table th:nth-child(4),
    .my-campaigns-table td:nth-child(4),
    .my-campaigns-table th:nth-child(6),
    .my-campaigns-table td:nth-child(6) {
        display: none;
    }
}

@media (max-width: 480px) {
    .detail-row {
        grid-template-columns: 1fr;
        row-gap: 4px;
    }
    
    .detail-row .label {
        color: #4e73df;
    }
}

