/* CBM Calculator Styles */

.cbm-calculator-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    padding: 100px 0 80px 0;
}

/* Header */
.cbm-header {
    margin-bottom: 4rem;
}

.cbm-title {
    font-size: 3rem;
    font-weight: 800;
    color: #005cb9;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 92, 185, 0.1);
}

.cbm-subtitle {
    font-size: 1.2rem;
    color: #6c757d;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* Calculator Sections */
.calculator-section {
    background: #ffffff;
    border-radius: 20px;
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.calculator-section:hover {
    border-color: #005cb9;
    box-shadow: 0 25px 80px rgba(0, 92, 185, 0.15);
    transform: translateY(-2px);
}

/* CBM Visualization */
.cbm-visualization {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 14px;
    padding: 1.25rem 1.25rem 1rem 1.25rem;
}

.cbm-legend {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #005cb9;
    font-weight: 700;
}

.container-visual {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e9ecef;
    border-radius: 14px;
    padding: 1rem;
}

.container-svg {
    width: 100%;
    height: auto;
    max-width: 900px;
    display: block;
    margin: 0 auto;
}

#cargoFill {
    transition: width 600ms cubic-bezier(.2, .8, .2, 1), fill 300ms ease, opacity 300ms ease;
}

#cargoFill.near-limit {
    fill: #ffc107;
}

#cargoFill.over-limit {
    fill: #dc3545;
    opacity: 0.9;
}

.section-title {
    color: #005cb9;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    font-size: 1.3rem;
}

/* Input Groups */
.input-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    width: 100%;
    text-align: left;
}

.calculator-input,
.form-select {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
    width: 100%;
}

.calculator-input:focus,
.form-select:focus {
    border-color: #005cb9;
    box-shadow: 0 0 0 3px rgba(0, 92, 185, 0.1);
    outline: none;
}

.input-group>.form-control,
.input-group>.form-select {
    width: 100%;
}

/* Result Sections */
.result-card {
    background: linear-gradient(135deg, #005cb9 0%, #004494 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 92, 185, 0.3);
}

.result-card h5 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* CBM Table Styles */
.cbm-table-container {
    background: #ffffff;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
}

.cbm-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.cbm-table th {
    background: linear-gradient(135deg, #005cb9 0%, #004494 100%);
    color: white;
    padding: 1rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid #003366;
}

.cbm-table td {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid #e9ecef;
    vertical-align: middle;
}

.table-input {
    width: 100%;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.3s ease;
    background: #ffffff;
}

.table-input:focus {
    border-color: #005cb9;
    box-shadow: 0 0 0 3px rgba(0, 92, 185, 0.1);
    outline: none;
}

.table-input[readonly] {
    background: #f8f9fa;
    color: #005cb9;
    font-weight: 600;
    cursor: not-allowed;
}

.multiply-symbol {
    font-size: 1.2rem;
    font-weight: bold;
    color: #6c757d;
    background: #f8f9fa;
}

/* Add Row Button */
.add-row-btn {
    background: linear-gradient(135deg, #28a745 0%, #20993a 100%);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
    cursor: pointer;
}

.add-row-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
    background: linear-gradient(135deg, #20993a 0%, #1e7e34 100%);
}

.add-row-btn i {
    margin-right: 8px;
}

/* Transport Selection */
.transport-selection {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.transport-label {
    font-weight: 600;
    color: #495057;
    margin: 0;
    font-size: 1rem;
}

.transport-dropdown {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 8px 15px;
    font-size: 1rem;
    background: #ffffff;
    transition: all 0.3s ease;
    min-width: 150px;
}

.transport-dropdown:focus {
    border-color: #005cb9;
    box-shadow: 0 0 0 3px rgba(0, 92, 185, 0.1);
    outline: none;
}

/* Results Section */
.results-section {
    background: linear-gradient(135deg, #005cb9 0%, #004494 100%);
    border-radius: 15px;
    padding: 2rem;
    color: white;
}

.results-section .result-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    height: 100%;
}

.results-section .result-item label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.result-input {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffc107;
    text-align: center;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    display: block;
}

.result-input:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2);
    outline: none;
}

/* Action Buttons */
.action-buttons {
    text-align: left;
}

.clear-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
    cursor: pointer;
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

/* Information Section */
.cbm-info-section {
    margin-top: 4rem;
}

.info-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.info-card h4 {
    color: #005cb9;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.info-card p {
    color: #6c757d;
    line-height: 1.7;
    margin-bottom: 0;
    white-space: pre-line;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cbm-calculator-section {
        padding: 80px 0 60px 0;
    }

    .cbm-title {
        font-size: 2.2rem;
    }

    .cbm-subtitle {
        font-size: 1.1rem;
    }

    .calculator-section {
        padding: 1.5rem;
    }

    .cbm-table-container {
        padding: 1rem;
        overflow-x: auto;
    }

    .cbm-table {
        min-width: 600px;
    }

    .cbm-table th,
    .cbm-table td {
        padding: 0.3rem;
        font-size: 0.8rem;
    }

    .table-input {
        padding: 6px 8px;
        font-size: 0.8rem;
    }

    .transport-selection {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .results-section {
        padding: 1.5rem;
    }

    .result-input {
        font-size: 1rem;
        padding: 8px 12px;
    }

    .info-card {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .cbm-title {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .calculator-section {
        padding: 1rem;
    }

    .info-card {
        padding: 1.5rem;
    }
}

/* Container Ship Animation */
.container-svg:hover {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

/* Enhanced Hover Effects */
.calculator-section {
    position: relative;
    overflow: hidden;
}

.calculator-section:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 92, 185, 0.05), transparent);
    transition: left 0.5s ease;
}

.calculator-section:hover:before {
    left: 100%;
}

/* Container Ship Specific Styles */
.container-ship {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

/* Water Animation */
@keyframes wave {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(10px);
    }
}

.container-svg g[opacity="0.4"] ellipse {
    animation: wave 3s ease-in-out infinite alternate;
}

/* Container Markings Animation */
.container-svg g[opacity="0.6"] rect {
    transition: fill 0.3s ease;
}

.container-svg g[opacity="0.6"] rect:hover {
    fill: #ffed4e;
}

/* Focus Improvements */
.btn:focus,
.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 92, 185, 0.25);
}

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn.loading {
    position: relative;
    pointer-events: none;
}

.btn.loading:after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Container Visualization Enhancements */
.container-visual {
    position: relative;
    overflow: hidden;
}

.container-visual::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 92, 185, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* CBM Result Highlight */
.cbm-result {
    color: #ffc107 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Container Capacity Indicators */
.capacity-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 92, 185, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Ship Details Enhancement */
.container-svg .ship-bridge {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.container-svg .ship-funnel {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Responsive Container SVG */
@media (max-width: 768px) {
    .container-svg {
        height: 250px;
    }
}

@media (max-width: 576px) {
    .container-svg {
        height: 200px;
    }
}