/* DRTR Tours Manager - Frontend Styles */

.drtr-container {
    max-width: 1600px;
    margin: 40px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.drtr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #003284;
}

.drtr-header h1 {
    margin: 0;
    color: #003284;
    font-size: 28px;
}

/* Botones */
.drtr-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.drtr-btn-primary {
    background: #003284;
    color: #fff;
}

.drtr-btn-primary:hover {
    background: #1aabe7;
}

.drtr-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.drtr-btn-secondary:hover {
    background: #5a6268;
}

.drtr-btn-danger {
    background: #dc3545;
    color: #fff;
    padding: 6px 12px;
    font-size: 12px;
}

.drtr-btn-danger:hover {
    background: #c82333;
}

.drtr-btn-edit {
    background: #17a2b8;
    color: #fff;
    padding: 6px 12px;
    font-size: 12px;
    margin-right: 5px;
}

.drtr-btn-edit:hover {
    background: #138496;
}

.drtr-duplicate-tour {
    background: #6c757d;
    color: #fff;
    padding: 6px 12px;
    font-size: 12px;
    margin-right: 5px;
}

.drtr-duplicate-tour:hover {
    background: #5a6268;
}

.drtr-btn-success {
    background: #28a745;
    color: #fff;
    padding: 6px 12px;
    font-size: 12px;
    margin-right: 5px;
}

.drtr-btn-success:hover {
    background: #218838;
}

/* Status badges */
.drtr-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

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

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

/* Toggle para publicación */
.drtr-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.drtr-toggle-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.drtr-toggle-text {
    font-size: 14px;
    font-weight: 500;
}

/* Búsqueda */
.drtr-search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.drtr-search-box input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

/* Tabla */
.drtr-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.drtr-table thead {
    background: #f8f9fa;
}

.drtr-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #003284;
    border-bottom: 2px solid #dee2e6;
}

.drtr-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.drtr-table tbody tr:hover {
    background: #f8f9fa;
}

.drtr-table .drtr-loading {
    text-align: center;
    padding: 40px;
}

.drtr-table .drtr-no-tours {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

/* Paginación */
.drtr-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.drtr-pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.drtr-pagination button:hover:not(:disabled) {
    background: #003284;
    color: #fff;
    border-color: #003284;
}

.drtr-pagination button.active {
    background: #003284;
    color: #fff;
    border-color: #003284;
}

.drtr-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.drtr-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.drtr-modal-content {
    background-color: #fff;
    margin: 50px auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.drtr-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.drtr-modal-close:hover {
    color: #000;
}

#drtr-modal-title {
    margin-top: 0;
    color: #003284;
}

/* Formulario */
.drtr-form-row {
    margin-bottom: 20px;
}

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

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

.drtr-form-group {
    display: flex;
    flex-direction: column;
}

.drtr-form-group label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.drtr-field-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.drtr-form-group input,
.drtr-form-group select,
.drtr-form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.drtr-form-group textarea {
    resize: vertical;
}

/* Image Upload & Preview */
.drtr-file-input {
    display: block;
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drtr-file-input:hover {
    border-color: #003284;
    background-color: #f8f9fa;
}

.drtr-image-preview {
    position: relative;
    margin-top: 15px;
    max-width: 300px;
}

.drtr-image-preview img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.drtr-remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.drtr-remove-image:hover {
    background: #ff4444;
    transform: scale(1.1);
}

.drtr-remove-image:hover .dashicons {
    color: #fff;
}

.drtr-remove-image .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #333;
    transition: color 0.2s ease;
}

/* Itinerario */
.drtr-itinerary-container {
    margin-bottom: 15px;
}

.drtr-itinerary-stop {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.drtr-stop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.drtr-stop-number {
    font-size: 18px;
    font-weight: 700;
    color: #003284;
    background: #fff;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #003284;
}

.drtr-remove-stop {
    background: #fff;
    border: 2px solid #dc3545;
    color: #dc3545;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.drtr-remove-stop:hover {
    background: #dc3545;
    color: #fff;
}

.drtr-stop-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.drtr-stop-field {
    display: flex;
    flex-direction: column;
}

.drtr-stop-field-full {
    grid-column: 1 / -1;
}

.drtr-stop-field label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #495057;
    font-size: 13px;
}

.drtr-stop-field input,
.drtr-stop-field select,
.drtr-stop-field textarea {
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.drtr-stop-field textarea {
    resize: vertical;
    font-family: inherit;
}

.drtr-stop-icon {
    font-size: 14px;
}

/* Thumbnail en tabla */
.drtr-image-cell {
    width: 60px;
    text-align: center;
}

.drtr-tour-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.drtr-no-image {
    font-size: 40px;
    color: #ccc;
}

.drtr-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

/* Mensajes */
.drtr-message {
    position: fixed;
    top: 50px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    min-width: 300px;
}

.drtr-message.success {
    background: #28a745;
    color: #fff;
}

.drtr-message.error {
    background: #dc3545;
    color: #fff;
}

/* Badges */
.drtr-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.drtr-badge-bus {
    background: #17a2b8;
    color: #fff;
}

.drtr-badge-avion {
    background: #6f42c1;
    color: #fff;
}

.drtr-badge-tren {
    background: #fd7e14;
    color: #fff;
}

.drtr-badge-barco {
    background: #20c997;
    color: #fff;
}

.drtr-badge-mixto {
    background: #6c757d;
    color: #fff;
}

/* Error */
.drtr-error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
}

/* Spinner WordPress */
.spinner {
    float: none;
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
    .drtr-form-row-2,
    .drtr-form-row-3 {
        grid-template-columns: 1fr;
    }
    
    .drtr-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .drtr-modal-content {
        width: 95%;
        margin: 20px auto;
        padding: 20px;
    }
    
    .drtr-table {
        font-size: 12px;
    }
    
    .drtr-table th,
    .drtr-table td {
        padding: 8px;
    }
}

/* Edit Page Styles */
.drtr-edit-page {
    max-width: 1200px;
}

.drtr-back-link {
    margin-bottom: 20px;
}

.drtr-back-link .drtr-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.drtr-edit-form-container {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    margin-top: 20px;
}

.drtr-form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #ddd;
}

.drtr-form-actions .drtr-btn {
    min-width: 150px;
}
