* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #001a3d;
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.header-content {
    flex: 1;
}

.logo {
    width: 120px;
    height: 120px;
    opacity: 0.9;
    transition: all 0.3s ease;
    animation: fadeIn 1s ease-out;
}

.logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #84BD00 0%, #425500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    animation: slideIn 0.6s ease-out;
}

.subtitle {
    font-size: 1.2rem;
    color: #888;
    margin-bottom: 3rem;
    animation: slideIn 0.8s ease-out;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        justify-content: center;
        text-align: center;
    }
    
    .header-content {
        order: 2;
    }
    
    .logo {
        order: 1;
        margin: 0 auto;
    }
    
    h1 {
        font-size: 2.5rem;
    }
}

.panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    animation: fadeIn 1s ease-out;
}

.panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(132, 189, 0, 0.2);
}

.input-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.country-selector {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.country-selector label {
    display: block;
    margin-bottom: 0.5rem;
    color: #84BD00;
    font-size: 0.9rem;
    font-weight: 600;
}

.country-select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.country-select:focus {
    outline: none;
    border-color: #84BD00;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 15px rgba(132, 189, 0, 0.2);
}

.country-select option {
    background: #1a1a2e;
    color: #fff;
}

.location-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .location-inputs {
        grid-template-columns: 1fr;
    }
}

.location-input-group {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.location-input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #84BD00;
    font-size: 0.9rem;
    font-weight: 600;
}

.location-input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.location-input:focus {
    outline: none;
    border-color: #84BD00;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 15px rgba(132, 189, 0, 0.2);
}

.location-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}

.individual-location-group {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.individual-location-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #84BD00;
    font-size: 0.9rem;
    font-weight: 600;
}

.input-with-button {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.input-with-button .location-input {
    flex: 1;
    margin: 0;
}

.btn-add {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #84BD00 0%, #425500 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-add:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(132, 189, 0, 0.4);
}

.btn-add:active {
    transform: scale(0.95);
}

.plus-icon {
    line-height: 1;
}

.address-input {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.address-input:focus {
    outline: none;
    border-color: #84BD00;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(132, 189, 0, 0.3);
}

.address-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #84BD00 0%, #425500 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(132, 189, 0, 0.4);
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    margin-left: 1rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

#map {
    width: 100%;
    height: 500px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.route-details {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0, 52, 115, 0.2);
    border-radius: 15px;
    border: 1px solid rgba(0, 52, 115, 0.4);
}

.route-item {
    padding: 1rem;
    margin: 0.5rem 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.route-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.route-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #84BD00 0%, #425500 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 1rem;
    flex-shrink: 0;
}

.route-address {
    flex: 1;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    background: linear-gradient(135deg, #84BD00 0%, #425500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: #888;
    margin-top: 0.5rem;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #84BD00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

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

.footer {
    margin-top: 4rem;
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    font-size: 0.9rem;
}

.footer a {
    color: #84BD00;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer a:hover {
    color: #a8e500;
    text-shadow: 0 0 10px rgba(132, 189, 0, 0.5);
}

.error {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    color: #ff3b30;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
}

.help-text {
    color: #888;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Google Places Autocomplete Styling */
.pac-container {
    background-color: #1a1a2e;
    border: 1px solid rgba(132, 189, 0, 0.3);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    margin-top: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pac-item {
    background-color: #1a1a2e;
    color: #e0e0e0;
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.pac-item:hover {
    background-color: rgba(132, 189, 0, 0.2);
}

.pac-item-selected {
    background-color: rgba(132, 189, 0, 0.3) !important;
}

.pac-matched {
    color: #84BD00;
    font-weight: bold;
}

.pac-item-query {
    color: #e0e0e0;
    font-size: 14px;
}

.pac-icon {
    display: none;
}

.hdpi .pac-icon {
    display: none;
}

.export-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Optimization Mode Toggle */
.optimization-mode {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.optimization-mode label {
    display: block;
    margin-bottom: 0.5rem;
    color: #84BD00;
    font-size: 0.9rem;
    font-weight: 600;
}

.mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.mode-toggle input[type="radio"] {
    display: none;
}

.mode-option {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mode-toggle input[type="radio"]:checked + .mode-option {
    background: rgba(132, 189, 0, 0.2);
    border-color: #84BD00;
}

.mode-title {
    display: block;
    font-weight: bold;
    color: #fff;
    margin-bottom: 0.25rem;
}

.mode-desc {
    display: block;
    font-size: 0.8rem;
    color: #888;
}

/* Advanced Options */
.advanced-options {
    background: rgba(132, 189, 0, 0.05);
    border: 1px solid rgba(132, 189, 0, 0.2);
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1rem;
    animation: slideIn 0.3s ease-out;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.option-group {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
}

.option-group label {
    display: block;
    color: #84BD00;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.number-input, .time-input {
    width: 100%;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
}

.number-input:focus, .time-input:focus {
    outline: none;
    border-color: #84BD00;
}

.route-preferences {
    margin-top: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    margin: 0.5rem 0;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label span {
    color: #e0e0e0;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.delivery-constraints {
    margin-top: 1rem;
}

.constraint-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: 6px;
    margin: 0.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.constraint-item input {
    margin: 0 0.5rem;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    width: 80px;
}

.vehicle-route {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid #84BD00;
}

.vehicle-header {
    font-weight: bold;
    color: #84BD00;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.btn-export {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: rgba(255, 255, 255, 0.1);
    flex: 1;
    min-width: 150px;
}

.btn-export:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 20px rgba(132, 189, 0, 0.3);
}

@media (max-width: 768px) {
    .export-buttons {
        flex-direction: column;
    }
    
    .btn-export {
        width: 100%;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .panel {
        background: white;
        border: 1px solid #ddd;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .route-item {
        background: #f5f5f5;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .header, .main-grid .input-section, .footer, .export-buttons, .btn {
        display: none !important;
    }
    
    .main-grid {
        display: block !important;
    }
    
    #map {
        height: 400px !important;
        margin-bottom: 30px;
        page-break-after: auto;
        border: 1px solid #ddd;
    }
    
    .route-details {
        background: white !important;
        border: none !important;
    }
    
    h2, h3 {
        color: black !important;
    }
    
    .stat-value {
        color: #425500 !important;
        -webkit-text-fill-color: #425500 !important;
    }
    
    #routeResults {
        page-break-before: auto;
    }
}
