/* Emirates Cargo Automation - Enhanced Styles */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Navigation Bar Styles */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* Commodity dropdown specific styles */
#commodity_dropdown {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

#commodity_dropdown::-webkit-scrollbar {
    width: 8px;
}

#commodity_dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}

#commodity_dropdown::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 8px;
}

#commodity_dropdown::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Container styles */
.container {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Header styles */
h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Form styles */
#cargoForm {
    background: rgba(255, 255, 255, 0.8);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.form-group {
    margin-bottom: 25px;
}

.form-row {
    display: flex;
    gap: 25px;
    margin-bottom: 10px;
}

.form-row .form-group {
    flex: 1;
}

/* Label styles */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Input styles */
input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

input:hover, select:hover, textarea:hover {
    border-color: #b8c5f3;
}

/* Button styles */
.btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 15px 35px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin-right: 15px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn:hover {
    background: linear-gradient(45deg, #5a6fd8, #6a4190);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background: linear-gradient(45deg, #bdc3c7, #95a5a6);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: linear-gradient(45deg, #6c757d, #495057);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(45deg, #5a6268, #343a40);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* Result styles */
.result {
    margin-top: 30px;
    padding: 20px;
    border-radius: 15px;
    display: none;
    border: 2px solid;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: #28a745;
    color: #155724;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-color: #dc3545;
    color: #721c24;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2);
}

/* Loading styles */
.loading {
    text-align: center;
    padding: 30px;
    display: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    margin-top: 20px;
    border: 2px solid #667eea;
}

.loading p {
    font-size: 1.1rem;
    color: #667eea;
    font-weight: 600;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Pre-formatted text styles */
pre {
    background: rgba(248, 249, 250, 0.9);
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    white-space: pre-wrap;
    border: 1px solid #e9ecef;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    #cargoForm {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
}

/* Additional enhancements */
.form-group:last-child {
    margin-bottom: 0;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #5a6fd8, #6a4190);
}

/* Table styles */
.table-container {
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideIn 0.5s ease-out;
}

.table-container h2 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
    font-weight: 600;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    z-index: 0;
}

.table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.response-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    overflow: visible;
    min-width: 1200px;
}

.response-table th {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 75px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    position: sticky;
    top: 0;
}

.response-table th:first-child {
    border-top-left-radius: 10px;
}

.response-table th:last-child {
    border-top-right-radius: 10px;
}

.response-table td {
    padding: 60px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    font-size: 0.9rem;
    color: #2c3e50;
    vertical-align: middle;
}

.response-table tbody tr {
    transition: all 0.3s ease;
}

.response-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.response-table tbody tr:nth-child(even) {
    background: rgba(248, 249, 250, 0.5);
}

.response-table tbody tr:nth-child(even):hover {
    background: rgba(102, 126, 234, 0.08);
}

/* Specific column styling */
.response-table td:nth-child(1) { /* Offer ID */
    font-weight: 600;
    color: #667eea;
}

.response-table td:nth-child(2),
.response-table td:nth-child(3),
.response-table td:nth-child(4),
.response-table td:nth-child(5) { /* Price columns */
    font-weight: 600;
    color: #28a745;
    text-align: right;
}

.response-table td:nth-child(6) { /* Weight */
    font-weight: 600;
    color: #6c757d;
    text-align: center;
}

.response-table td:nth-child(7) { /* Goods */
    font-weight: 600;
    color: #fd7e14;
}

.response-table td:nth-child(8) { /* Journey Time */
    color: #6f42c1;
    font-weight: 500;
}

.response-table td:nth-child(9) { /* Route */
    font-weight: 600;
    color: #17a2b8;
    font-family: 'Courier New', monospace;
}

.response-table td:nth-child(10) { /* Stops */
    text-align: center;
    font-weight: 600;
    color: #dc3545;
}

.response-table td:nth-child(11),
.response-table td:nth-child(12) { /* Times */
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #495057;
}

/* Tooltip styles */
.tooltip-container {
    position: relative;
    cursor: help;
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44, 62, 80, 0.95);
    color: white;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(44, 62, 80, 0.95);
    z-index: 9999;
}

.tooltip-container:hover .tooltip {
    opacity: 1;
    visibility: visible;
    z-index: 9999;
}

.tooltip-line {
    display: block;
    margin-bottom: 4px;
    text-align: left;
}

.tooltip-line:last-child {
    margin-bottom: 0;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

/* Responsive table */
@media (max-width: 768px) {
    .table-container {
        padding: 20px;
        margin-top: 30px;
    }
    
    .table-container h2 {
        font-size: 1.5rem;
    }
    
    .response-table {
        min-width: 1000px;
    }
    
    .response-table th,
    .response-table td {
        padding: 10px 8px;
        font-size: 0.8rem;
    }
}
