/* Import Poppins font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f0f2f5, #e9ecef);
    color: #333;
    line-height: 1.6;
}

/* Header */
header {
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.logo {
    height: 60px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

nav a {
    color: white;
    margin-left: 25px;
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #dbeafe;
}

nav a i {
    margin-right: 5px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.container:hover {
    transform: translateY(-5px);
}

/* Auth Container */
.auth-container {
    max-width: 500px;
    margin: 80px auto;
}

.auth-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.tab-btn {
    background: #e5e7eb;
    color: #1e3a8a;
    padding: 10px 20px;
    border: none;
    border-radius: 8px 8px 0 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
    margin: 0 5px;
}

.tab-btn.active {
    background: #3b82f6;
    color: white;
}

.tab-btn:hover:not(.active) {
    background: #d1d5db;
}

.tab-content {
    background: white;
    padding: 20px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
}

/* Forms (General) */
h1 {
    color: #1e3a8a;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

form {
    display: flex;
    flex-direction: column;
}

input, select {
    margin: 12px 0;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.3s ease;
}

input:focus, select:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.3);
}

button {
    margin: 12px 0;
    padding: 12px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

button:hover {
    background: #1e3a8a;
    transform: translateY(-2px);
}

button i {
    margin-right: 8px;
}

/* Admin Form Specific Styles */
.admin-form {
    gap: 15px;
}

.admin-form .admin-form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.admin-form .form-group {
    flex: 1;
    min-width: 200px;
}

.admin-form .form-group label {
    display: block;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 5px;
}

.admin-form .form-group label i {
    margin-right: 5px;
}

.admin-form input {
    width: 100%;
    padding: 10px;
    margin: 0;
}

/* Calendar View */
.calendar-view {
    margin-bottom: 30px;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-table th, .calendar-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.calendar-table th {
    background: #f8fafc;
    color: #1e3a8a;
    font-weight: 600;
}

.calendar-table td button {
    padding: 8px 12px;
    font-size: 14px;
    background: #10b981;
}

.calendar-table td button:hover {
    background: #059669;
}

/* Table (Registered Runs/Admin Runs) */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 25px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background: #f8fafc;
    color: #1e3a8a;
    font-weight: 600;
}

td button {
    padding: 8px 12px;
    font-size: 14px;
}

.signup-btn {
    background: #10b981;
}

.signup-btn:hover {
    background: #059669;
}

.cancel-btn {
    background: #ef4444;
}

.cancel-btn:hover {
    background: #dc2626;
}

.replace-btn {
    background: #f59e0b;
    margin-left: 10px;
}

.replace-btn:hover {
    background: #d97706;
}

.map-btn, .details-btn, .edit-btn, .duplicate-btn {
    background: #8b5cf6;
}

.map-btn:hover, .details-btn:hover, .edit-btn:hover, .duplicate-btn:hover {
    background: #7c3aed;
}

.delete-btn {
    background: #ef4444;
}

.delete-btn:hover {
    background: #dc2626;
}

.creative-preview {
    display: flex;
    align-items: center;
    gap: 10px;
}

.thumbnail {
    max-width: 100px;
    max-height: 100px;
    border-radius: 4px;
}

/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    max-width: 700px;
    width: 90%;
    text-align: center;
    max-height: 80vh;
    overflow-y: auto;
}

.popup-content h3 {
    margin-bottom: 15px;
}

.popup-content p {
    margin-bottom: 20px;
}

.popup-content button {
    margin: 0 10px;
    padding: 10px 20px;
}

.map-container {
    height: 400px;
    width: 100%;
    margin-bottom: 20px;
}

.signup-list, .message-list {
    text-align: left;
}

.signup-item, .customer-messages {
    border: 1px solid #e5e7eb;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
}

.signup-item p, .customer-messages p {
    margin: 5px 0;
}

.customer-messages h4 {
    margin-bottom: 10px;
    color: #1e3a8a;
}

.chat-container {
    background: #f8fafc;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.chat-history {
    max-height: 300px;
    overflow-y: auto;
    padding: 5px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.chat-history::-webkit-scrollbar {
    width: 8px;
}

.chat-history::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

.chat-history::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.message {
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 6px;
    position: relative;
}

.user-message {
    background: #e0f2fe;
    text-align: left;
    margin-right: 20%;
}

.admin-message {
    background: #dcfce7;
    text-align: right;
    margin-left: 20%;
}

.message span {
    font-size: 12px;
    color: #6b7280;
    display: block;
    margin-top: 5px;
}

.admin-response, #chat-message {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    resize: none;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    background: #fff;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.admin-response:focus, #chat-message:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.3);
    outline: none;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    text-align: center;
    font-size: 12px;
    color: #1e3a8a;
    transition: width 0.3s ease;
}

/* Unread Dot */
.unread-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    margin-left: 8px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 20px;
    }
    nav {
        margin-top: 15px;
    }
    nav a {
        margin: 0 10px;
    }
    .container {
        margin: 20px;
        padding: 15px;
    }
    .admin-form .admin-form-row {
        flex-direction: column;
        gap: 15px;
    }
    .calendar-table, table {
        font-size: 14px;
    }
    .calendar-table th, .calendar-table td, th, td {
        padding: 10px;
    }
    .creative-preview {
        flex-direction: column;
        align-items: flex-start;
    }
    .user-message, .admin-message {
        margin-left: 0;
        margin-right: 0;
    }
}

/* --- NEW STYLES FOR CONFIRMATION MODAL --- */

/* Re-use existing popup styles but allow for smaller width */
#confirmation-modal .popup-content {
    max-width: 400px;
    text-align: center;
}

#confirmation-modal h3 {
    margin-top: 0;
}

/* General button styles for modal */
.btn-danger, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    margin: 0 10px;
    color: white;
    transition: background-color 0.3s ease;
}

.btn-danger {
    background-color: #dc3545; /* Red */
}
.btn-danger:hover {
    background-color: #c82333;
}

.btn-secondary {
    background-color: #6c757d; /* Gray */
}
.btn-secondary:hover {
    background-color: #5a6268;
}

/* Table for signups popup */
.popup-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.popup-table th, .popup-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
.popup-table th {
    background-color: #f8fafc;
    color: #1e3a8a;
}
