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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

/* Vessel Count Section Styles */
.vessel-count-section {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.vessel-count-section label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
    margin: 0;
}

.vessel-count-section input {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    width: 120px;
    transition: border-color 0.2s ease;
}

.vessel-count-section input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Departure Days Section Styles */
.departure-days-section {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.departure-days-section label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
    margin: 0;
}

.departure-days-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.day-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 50px;
}

.day-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.day-btn.selected {
    background: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.day-btn.selected:hover {
    background: #0056b3;
}

.departure-days-error {
    color: #dc3545;
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.departure-days-error.show {
    display: block;
}

/* Departure Day Column Styles */
.day-of-week-display {
    background: #e9ecef;
    color: #495057;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border: 1px solid #dee2e6;
    min-width: 60px;
    max-width: 80px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 300;
}

.port-list {
    margin-bottom: 30px;
}

.port-row {
    display: grid;
    grid-template-columns: 120px 1fr 150px 80px 80px;
    gap: 15px;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.port-row:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.port-row select,
.port-row input {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    width: 100%;
    min-width: 0;
}

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

.port-row input[type="date"] {
    min-width: 150px;
    max-width: 150px;
}

.port-row select {
    background: white;
    cursor: pointer;
    min-width: 120px;
}

.cargo-operations-select {
    min-width: 130px;
    max-width: 150px;
}


.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
    min-width: 80px;
    width: 80px;
}

.delete-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

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

.add-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: block;
    margin: 0 auto;
    min-width: 120px;
    width: auto;
}

.add-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

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

.schedule-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin: 0 auto;
    min-width: 140px;
    width: auto;
}

.schedule-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

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

.template-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.template-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

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

.template-btn.active {
    background: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.template-btn.active:hover {
    background: #0056b3;
}


.schedule-display {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.schedule-display h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 400;
}

.schedule-content {
    display: grid;
    gap: 15px;
}

.schedule-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 15px;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.schedule-item:hover {
    background: #f1f3f4;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.schedule-date {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.schedule-port {
    color: #2c3e50;
    font-size: 16px;
}

.schedule-cycle {
    margin-bottom: 20px;
}

.cycle-header {
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.schedule-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    text-align: center;
    font-weight: 500;
}

.field-labels {
    display: grid;
    grid-template-columns: 120px 1fr 150px 80px 80px;
    gap: 15px;
    margin-bottom: 10px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    padding: 0 15px;
}

.price-matrix-table {
    width: 100%;
    min-width: 800px;
    margin-top: 30px;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.price-matrix-table th,
.price-matrix-table td {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #dee2e6;
    font-size: 14px;
}

.price-matrix-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
}

.price-matrix-table th.port-header {
    background: #007bff;
    color: white;
    min-width: 100px;
}

.price-matrix-table th.fixed-header {
    background: #495057;
    color: white;
    position: sticky;
    left: 0;
    z-index: 11;
}

.price-matrix-table td.fixed-column {
    background: #f8f9fa;
    font-weight: 500;
    position: sticky;
    left: 0;
    z-index: 9;
}

.price-input {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
    background: white;
}

.price-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.price-input.disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.price-cell-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-height: 60px;
    justify-content: center;
}

.na-checkbox {
    font-size: 10px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
}

.na-checkbox input[type="checkbox"] {
    margin: 0;
    transform: scale(0.8);
}

.price-input.na-selected {
    background: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
}

.na-indicator {
    font-size: 11px;
    color: #6c757d;
    font-style: italic;
    text-align: center;
}

.price-cell-disabled {
    background: #f8f9fa !important;
    color: #6c757d;
    font-weight: 500;
}

.price-matrix-container {
    overflow-x: scroll;
    margin-top: 30px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    max-width: 100%;
    width: 100%;
}

.price-matrix-title {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 400;
}

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.field-container {
    position: relative;
}

.field-container.error input,
.field-container.error select {
    border-color: #dc3545;
}

.field-container.error .error-message {
    display: block;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }

    .port-row {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: center;
    }

    .field-labels {
        display: none;
    }

    .port-row select,
    .port-row input {
        width: 100%;
    }
    
.days-between {
    font-size: 14px;
    padding: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin: 5px 0;
}

.sailing-days-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    background: white;
    transition: border-color 0.2s ease;
}

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

.sailing-days-input:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #dee2e6;
}

.cargo-operations-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    background: white;
    transition: border-color 0.2s ease;
}

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

    .price-matrix-table th,
    .price-matrix-table td {
        padding: 8px 4px;
        font-size: 12px;
    }

    .price-input {
        width: 60px;
        font-size: 11px;
        padding: 4px 6px;
    }

    .price-cell-container {
        min-height: 50px;
        gap: 2px;
    }

    .na-checkbox {
        font-size: 9px;
    }

    .price-matrix-table th.fixed-header,
    .price-matrix-table td.fixed-column {
        position: static;
    }

    .price-matrix-container {
        font-size: 12px;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

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

