/* TravelTracks.org v2.0.251127 - Modal Styles */

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: block;
}

/* Modal Container */
.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    max-width: 550px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

.modal.active {
    display: block;
}

/* Modal Header */
.modal-header {
    padding: 24px 24px 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.4em;
    color: white;
    font-weight: 600;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: white;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Modal Body */
.modal-body {
    padding: 24px;
    max-height: calc(85vh - 140px);
    overflow-y: auto;
}

/* Modal Form */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    font-size: 0.9em;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    color: #666;
    font-size: 0.85em;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

/* Required field indicator */
.form-group label.required::after {
    content: " *";
    color: #dc3545;
}

/* Form validation */
.form-group input.invalid,
.form-group select.invalid,
.form-group textarea.invalid {
    border-color: #dc3545;
}

.form-group .error-message {
    color: #dc3545;
    font-size: 0.85em;
    margin-top: 2px;
}

/* Modal Footer */
.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: #f9fafb;
    border-radius: 0 0 12px 12px;
}   border-radius: 0 0 8px 8px;
}

.modal-footer button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-cancel {
    background-color: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background-color: #5a6268;
}

.btn-save {
    background-color: #007bff;
    color: white;
}

.btn-save:hover {
    background-color: #0056b3;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
    margin-right: auto;
}

.btn-delete:hover {
    background-color: #c82333;
}

/* Loading State */
.modal-body.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }
    
    .modal-header h2 {
        font-size: 1.2em;
    }
}

/* Trip Type Specific Styles */
.trip-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.trip-type-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.trip-type-btn:hover {
    border-color: #007bff;
}

.trip-type-btn.active {
    border-color: #007bff;
    background-color: #e7f3ff;
    color: #007bff;
}

.trip-type-btn .icon {
    font-size: 1.5em;
    display: block;
    margin-bottom: 5px;
}

/* Field Groups */
.field-group {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.field-group-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1em;
}

/* Conditional Fields */
.conditional-field {
    display: none;
}

.conditional-field.active {
    display: block;
}

/* Success Message */
.success-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Error Message */
.error-message-box {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
}


/* Share Modal Specific Styles */
.checkbox-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
    background: white;
    font-size: 14px;
}

.checkbox-label:hover {
    background-color: #f9fafb;
    border-color: #667eea;
    transform: translateY(-1px);
}

.checkbox-label input[type="checkbox"]:checked + span {
    font-weight: 600;
}

.checkbox-label:has(input:checked) {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

.date-range-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-range-group input[type="date"] {
    flex: 1;
}

.share-link-container {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.share-link-container input {
    flex: 1;
    font-family: monospace;
    font-size: 14px;
    background-color: white;
}

.share-stats {
    margin: 20px 0;
    padding: 15px;
    background-color: #e8f5e9;
    border-radius: 4px;
}

.share-stats ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.share-stats li {
    margin: 5px 0;
}

.share-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.share-actions button {
    flex: 1;
}

/* Manage Shares Modal */
.modal-large .modal-content {
    max-width: 900px;
}

.shares-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.share-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background-color: #fafafa;
    transition: all 0.2s;
}

.share-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.share-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.share-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
}

.share-card-description {
    color: #666;
    font-size: 14px;
    margin: 0 0 10px 0;
}

.share-card-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #777;
    margin-bottom: 10px;
}

.share-card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.share-card-link {
    font-family: monospace;
    font-size: 12px;
    color: #4CAF50;
    background-color: white;
    padding: 8px;
    border-radius: 4px;
    margin: 10px 0;
    word-break: break-all;
}

.share-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.share-card-actions button {
    font-size: 13px;
    padding: 6px 12px;
}

.share-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.share-status-badge.active {
    background-color: #4CAF50;
    color: white;
}

.share-status-badge.inactive {
    background-color: #999;
    color: white;
}

.loading-message {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-message {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-message button {
    margin-top: 15px;
}

/* Embed Code Section */
.share-embed-section {
    margin: 20px 0;
    padding: 15px;
    background-color: #f0f7ff;
    border-radius: 4px;
    border-left: 4px solid #2196F3;
}

.share-embed-section h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.embed-description {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
}

.share-embed-section textarea {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    resize: vertical;
    min-height: 80px;
}
