/* Ports Meta Plugin Frontend Styles */

/* Port List Styles */
.ports-list-container {
    margin: 20px 0;
}

.ports-table-container {
    overflow-x: auto;
    margin: 0 0;
}

.ports-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ports-table th,
.ports-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.ports-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
    border-top: 2px solid #0073aa;
}

.ports-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.ports-table tr:hover {
    background-color: #f1f1f1;
}

.ports-table a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.ports-table a:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Bunker Port Status */
.bunker-yes {
    color: #46b450;
    font-weight: bold;
}

.bunker-no {
    color: #dc3232;
    font-weight: bold;
}

.bunker-yes::before {
    content: "✓ ";
}

.bunker-no::before {
    content: "✗ ";
}

/* Coordinates */
.coordinates {
    font-family: monospace;
    font-size: 0.9em;
    cursor: pointer;
    color: #0073aa;
}

.coordinates:hover {
    text-decoration: underline;
}

/* No ports found message */
.no-ports-found {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Port Info Styles */
.port-info-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.port-info-title {
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.port-basic-info,
.port-coordinates,
.port-codes,
.port-description {
    margin-bottom: 20px;
}

.port-basic-info p,
.port-coordinates p,
.port-codes p {
    margin: 8px 0;
}

.port-basic-info strong,
.port-coordinates strong,
.port-codes strong {
    color: #333;
    display: inline-block;
    min-width: 120px;
}

.port-codes-list {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-family: monospace;
    white-space: pre-wrap;
    margin: 10px 0;
}

.map-link {
    background: #0073aa;
    color: white !important;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none !important;
    display: inline-block;
    margin-top: 10px;
    transition: background 0.3s ease;
}

.map-link:hover {
    background: #005a87 !important;
    color: white !important;
}

/* Port Search Styles */
.port-search-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.port-search-form {
    margin-bottom: 20px;
}

.search-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.port-search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.port-search-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}

.port-search-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.port-search-button:hover {
    background: #005a87;
}

.search-filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.port-filter {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    min-width: 150px;
}

.port-filter:focus {
    outline: none;
    border-color: #0073aa;
}

/* Search Results */
.port-search-results {
    margin-top: 20px;
}

.search-results-list {
    margin-top: 15px;
}

.search-result-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    transition: box-shadow 0.3s ease;
}

.search-result-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-result-item h4 {
    margin: 0 0 8px 0;
    color: #333;
}

.search-result-item h4 a {
    color: #0073aa;
    text-decoration: none;
}

.search-result-item h4 a:hover {
    color: #005a87;
    text-decoration: underline;
}

.result-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.result-meta span {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.9em;
    color: #495057;
}

.result-meta .country {
    background: #d4edda;
    color: #155724;
}

.result-meta .area {
    background: #d1ecf1;
    color: #0c5460;
}

.result-meta .bunker-port {
    background: #fff3cd;
    color: #856404;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Map Container */
.ports-map-container {
    margin-bottom: 20px;
}

#ports-map {
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f0f0f0;
}

/* Port Template Styles */
.port-single-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.port-single-title {
    color: #333;
    border-bottom: 3px solid #0073aa;
    padding-bottom: 15px;
    margin-bottom: 30px;
    font-size: 2.5em;
}

.port-single-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.port-meta-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.port-meta-section h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ports-table th,
    .ports-table td {
        padding: 8px 10px;
        font-size: 0.9em;
    }
    
    .search-input-group {
        flex-direction: column;
    }
    
    .port-search-input {
        min-width: auto;
        width: 100%;
    }
    
    .search-filters {
        flex-direction: column;
    }
    
    .port-filter {
        min-width: auto;
        width: 100%;
    }
    
    .result-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .port-single-container {
        padding: 20px 15px;
        margin: 0 10px;
    }
    
    .port-single-title {
        font-size: 2em;
    }
    
    .port-single-meta {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .ports-table {
        font-size: 0.8em;
    }
    
    .ports-table th,
    .ports-table td {
        padding: 6px 8px;
    }
    
    .port-info-container,
    .port-search-container {
        padding: 15px;
        margin: 15px 0;
    }
    
    .map-link {
        padding: 6px 12px;
        font-size: 0.9em;
    }
}

/* Print Styles */
@media print {
    .port-search-container,
    .map-link,
    .port-search-button {
        display: none;
    }
    
    .ports-table {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .ports-table th {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
