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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* Help Icon Styles */
.help-icon {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #3498db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.help-icon:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.help-icon span {
    color: white;
    font-size: 18px;
    font-weight: bold;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Pro Tip Popup Styles */
.pro-tip-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.pro-tip-popup.show {
    display: flex;
}

.pro-tip-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: popupSlideIn 0.3s ease;
    overflow: hidden;
}

.pro-tip-header {
    background: linear-gradient(45deg, #3498db, #2ecc71);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pro-tip-header strong {
    font-size: 1.1rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

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

.pro-tip-content p {
    padding: 20px;
    margin: 0;
    color: #333;
    line-height: 1.6;
    font-size: 1rem;
}

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

/* Mobile adjustments for help icon */
@media (max-width: 768px) {
    .help-icon {
        width: 35px;
        height: 35px;
        top: 15px;
        right: 15px;
    }
    
    .help-icon span {
        font-size: 16px;
    }
    
    .pro-tip-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2rem;
    color: #7f8c8d;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.panel {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid #e1e8ed;
}

.panel h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

/* Truck Selection Styles */
.truck-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.truck-option {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.truck-option:hover {
    border-color: #3498db;
    background: #e3f2fd;
}

.truck-option.active {
    border-color: #3498db;
    background: #e3f2fd;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

.truck-visual {
    height: 60px;
    margin: 0 auto 10px;
    border-radius: 4px;
    position: relative;
}

.truck-visual.box-truck {
    width: 80px;
    background: linear-gradient(145deg, #ff6b6b, #ee5a52);
    border-radius: 6px;
}

.truck-visual.dry-van {
    width: 120px;
    background: linear-gradient(145deg, #4ecdc4, #44a08d);
    border-radius: 6px;
}

.truck-img {
    width: 120px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #ddd;
}

.truck-visual.flatbed {
    width: 120px;
    background: linear-gradient(145deg, #feca57, #ff9ff3);
    border-radius: 6px;
    border: 2px solid #f39c12;
}

.truck-option h3 {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

.truck-option p {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.truck-adjustments {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.adjustment-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.adjustment-row label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 120px;
}

.adjustment-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.adjustment-row select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
}

/* Hazmat Section Styles */
.hazmat-section {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
}

.hazmat-section h3 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hazmat-section h3::before {
    content: "⚠️";
    font-size: 1.2rem;
}

.hazmat-warning {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 12px;
    margin-top: 10px;
}

.hazmat-warning p {
    color: #721c24;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.hazmat-warning ul {
    margin: 0;
    padding-left: 20px;
}

.hazmat-warning li {
    color: #721c24;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.hazmat-selected .truck-option {
    border-color: #fd7e14;
    background: #fff3cd;
}

.hazmat-selected .truck-option.active {
    border-color: #fd7e14;
    background: #fff3cd;
    box-shadow: 0 2px 10px rgba(253, 126, 20, 0.3);
}

/* Pallet Form Styles */
.pallet-form .form-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.pallet-form label {
    min-width: 100px;
    font-weight: 600;
    color: #2c3e50;
}

.pallet-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.btn-primary, .btn-secondary, .btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #3498db;
    color: white;
    width: 100%;
    margin-top: 10px;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* PDF Button Specific Styling */
#share-pdf {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    margin-top: 5px;
}

#share-pdf:hover {
    background: linear-gradient(45deg, #c0392b, #a93226);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

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

/* Message System */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    pointer-events: none;
}

.message {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e1e8ed;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 350px;
    backdrop-filter: blur(10px);
}

.message.show {
    transform: translateX(0);
    opacity: 1;
}

.message.hide {
    transform: translateX(100%);
    opacity: 0;
}

.message-success {
    border-left: 4px solid #27ae60;
    background: rgba(39, 174, 96, 0.1);
}

.message-error {
    border-left: 4px solid #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.message-info {
    border-left: 4px solid #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.message-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.message-text {
    font-size: 14px;
    color: #2c3e50;
    line-height: 1.4;
}

/* Pallet Unfitted Visual Feedback */
.pallet-unfitted {
    background: rgba(231, 76, 60, 0.1) !important;
    border: 2px solid #e74c3c !important;
    animation: pulseError 1s ease-in-out 3;
}

@keyframes pulseError {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    margin: 0 5px;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
    margin: 0 5px;
}

.btn-danger:hover {
    background: #c0392b;
}

.pallet-list {
    margin-top: 20px;
}

.pallet-list h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.pallet-item {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    display: flex;
    justify-content: between;
    align-items: center;
}

.pallet-info {
    flex: 1;
}

.pallet-info strong {
    color: #2c3e50;
}

.pallet-remove {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Visualization Area */
.visualization-area {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid #e1e8ed;
}

.viz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.viz-header h2 {
    color: #2c3e50;
    font-size: 1.5rem;
}

.stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stats span {
    background: #ecf0f1;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.truck-bed-container {
    position: relative;
    margin: 20px 0;
}

.truck-bed {
    background: #f8f9fa;
    border: 3px solid #34495e;
    border-radius: 8px;
    min-height: 200px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background-image: 
        linear-gradient(90deg, #e1e8ed 1px, transparent 1px),
        linear-gradient(#e1e8ed 1px, transparent 1px);
    background-size: 40px 40px;
}

.measurements {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.length-measure, .width-measure {
    background: #3498db;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
}

.loading-options {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}

.load-mode {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.load-mode label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #2c3e50;
    cursor: pointer;
}

.load-mode input[type="radio"] {
    margin: 0;
}

.controls {
    text-align: center;
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

/* Pallet Visualization */
.pallet-visual {
    position: absolute;
    border: 2px solid #2c3e50;
    border-radius: 4px;
    background: #3498db;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.pallet-visual:hover {
    background: #2980b9;
    transform: scale(1.05);
    z-index: 10;
}

.pallet-visual .pallet-name {
    font-weight: bold;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.pallet-visual .pallet-weight {
    font-size: 0.7rem;
    opacity: 0.9;
}

/* Enhanced Responsive Design */

/* Mobile Portrait (up to 768px) */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        max-width: 100%;
    }
    
    header h1 {
        font-size: 2rem;
        margin-bottom: 5px;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .panel {
        padding: 15px;
        border-radius: 8px;
    }
    
    .panel h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    /* Truck Selection Improvements */
    .truck-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .truck-option {
        padding: 12px;
        display: flex;
        align-items: center;
        text-align: left;
        gap: 12px;
    }
    
    .truck-visual, .truck-img {
        width: 60px;
        height: 40px;
        flex-shrink: 0;
    }
    
    .truck-option h3 {
        font-size: 1rem;
        margin-bottom: 3px;
    }
    
    .truck-option p {
        font-size: 0.85rem;
        margin: 0;
    }
    
    /* Form Improvements */
    .truck-adjustments {
        gap: 12px;
    }
    
    .adjustment-row {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .adjustment-row label {
        min-width: auto;
        font-size: 0.95rem;
    }
    
    .adjustment-row input,
    .adjustment-row select {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 8px;
    }
    
    .pallet-form .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
        margin-bottom: 12px;
    }
    
    .pallet-form label {
        min-width: auto;
        font-size: 0.95rem;
    }
    
    .pallet-form input {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 8px;
    }
    
    .btn-primary {
        padding: 15px 20px;
        font-size: 1.1rem;
        border-radius: 8px;
    }
    
    /* Hazmat Section */
    .hazmat-section {
        padding: 12px;
    }
    
    .hazmat-section h3 {
        font-size: 1.1rem;
    }
    
    /* Pallet List */
    .pallet-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }
    
    .pallet-info {
        margin-bottom: 8px;
    }
    
    .pallet-remove {
        align-self: stretch;
        padding: 10px;
        font-size: 0.9rem;
    }
    
    /* Visualization Area */
    .visualization-area {
        padding: 15px;
    }
    
    .viz-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .viz-header h2 {
        font-size: 1.3rem;
        text-align: center;
    }
    
    .stats {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .stats span {
        text-align: center;
        padding: 10px 15px;
        font-size: 0.95rem;
    }
    
    /* Truck Bed Visualization */
    .truck-bed-container {
        margin: 15px 0;
    }
    
    .truck-bed {
        min-height: 300px;
        width: 100%;
        border-radius: 8px;
        border-width: 2px;
    }
    
    .measurements {
        flex-direction: column;
        gap: 8px;
        margin-top: 8px;
    }
    
    .length-measure, .width-measure {
        text-align: center;
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    /* Loading Options */
    .loading-options {
        padding: 12px;
        margin: 15px 0;
    }
    
    .load-mode {
        gap: 12px;
    }
    
    .load-mode label {
        font-size: 0.95rem;
        padding: 8px 0;
    }
    
    /* Controls */
    .controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        margin-top: 15px;
    }
    
    .controls button {
        padding: 12px 20px;
        font-size: 1rem;
        border-radius: 8px;
        margin: 2px 0;
    }
    
    /* Pallet Visuals */
    .pallet-visual {
        font-size: 0.7rem;
        padding: 3px;
    }
    
    .pallet-visual .pallet-name {
        font-size: 0.65rem;
    }
    
    .pallet-visual .pallet-weight {
        font-size: 0.6rem;
    }
    
    /* Help Icon */
    .help-icon {
        width: 35px;
        height: 35px;
        top: 15px;
        right: 15px;
    }
    
    .help-icon span {
        font-size: 16px;
    }
    
    .pro-tip-content {
        margin: 20px;
        width: calc(100% - 40px);
        max-width: none;
    }
    
    /* Message System Mobile */
    .message-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .message {
        max-width: none;
        margin: 0 10px 10px 10px;
    }
    
    .message-text {
        font-size: 13px;
    }
    
    /* App Footer Mobile */
    .app-footer {
        padding: 10px 0;
        margin-top: 20px;
    }
    
    .app-footer .footer-links {
        flex-direction: column;
        gap: 6px;
        margin-bottom: 4px;
    }
    
    .app-footer .footer-links a {
        font-size: 0.75rem;
    }
    
    .app-footer .footer-bottom {
        font-size: 0.65rem;
    }
}

/* Mobile Landscape (up to 896px wide, up to 500px tall) */
@media (max-width: 896px) and (max-height: 500px) and (orientation: landscape) {
    .container {
        padding: 8px;
        display: grid;
        grid-template-columns: 300px 1fr;
        gap: 15px;
        height: 100vh;
        overflow: hidden;
    }
    
    header {
        grid-column: 1 / -1;
        margin-bottom: 10px;
        text-align: center;
    }
    
    header h1 {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }
    
    header p {
        font-size: 0.9rem;
    }
    
    .main-content {
        grid-column: 1;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 0;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    .panel {
        padding: 10px;
    }
    
    .panel h2 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .truck-options {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .truck-option {
        padding: 8px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .truck-visual, .truck-img {
        width: 40px;
        height: 25px;
    }
    
    .truck-option h3 {
        font-size: 0.9rem;
        margin-bottom: 2px;
    }
    
    .truck-option p {
        font-size: 0.75rem;
        margin: 0;
    }
    
    .adjustment-row {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    
    .adjustment-row label {
        min-width: 80px;
        font-size: 0.85rem;
    }
    
    .adjustment-row input,
    .adjustment-row select {
        padding: 6px 8px;
        font-size: 14px;
    }
    
    .pallet-form .form-row {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .pallet-form label {
        min-width: 70px;
        font-size: 0.85rem;
    }
    
    .pallet-form input {
        padding: 6px 8px;
        font-size: 14px;
    }
    
    .btn-primary {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .visualization-area {
        grid-column: 2;
        padding: 10px;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    .viz-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .viz-header h2 {
        font-size: 1.2rem;
    }
    
    .stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .stats span {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .truck-bed {
        min-height: 200px;
        max-height: 250px;
    }
    
    .controls {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        margin-top: 10px;
    }
    
    .controls button {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .help-icon {
        width: 30px;
        height: 30px;
        top: 10px;
        right: 10px;
    }
    
    .help-icon span {
        font-size: 14px;
    }
}

/* Small Mobile Screens (up to 480px) */
@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .panel {
        padding: 12px;
    }
    
    .truck-bed {
        min-height: 250px;
    }
    
    .stats {
        font-size: 0.85rem;
    }
    
    .stats span {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .controls button {
        font-size: 0.9rem;
        padding: 10px 15px;
    }
}

/* Very Small Screens (up to 320px) */
@media (max-width: 320px) {
    .container {
        padding: 5px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .panel {
        padding: 10px;
    }
    
    .panel h2 {
        font-size: 1.2rem;
    }
    
    .stats span {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
}

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

.pallet-visual {
    animation: fadeIn 0.3s ease;
}

/* App Footer Styles */
.app-footer {
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 0;
    margin-top: 30px;
    z-index: 10;
}

.app-footer .footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.app-footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.app-footer .footer-links a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.8rem;
}

.app-footer .footer-links a:hover {
    color: #2ecc71;
    text-decoration: underline;
}

.app-footer .footer-bottom {
    color: #95a5a6;
    font-size: 0.7rem;
    margin-top: 2px;
}

.app-footer .footer-bottom p {
    margin: 0;
}

/* Color coding for different pallet types */
.pallet-visual.heavy {
    background: #e74c3c;
}

.pallet-visual.medium {
    background: #f39c12;
}

.pallet-visual.light {
    background: #27ae60;
}

.pallet-visual.clearance-warning {
    background: #e67e22 !important;
    border: 2px solid #d35400 !important;
    box-shadow: 0 0 10px rgba(211, 84, 0, 0.5);
}

/* Center of Gravity Indicators */
.center-of-gravity {
    position: absolute;
    z-index: 1000;
    pointer-events: none;
    color: #e74c3c;
    text-shadow: 
        2px 2px 4px rgba(0,0,0,0.8),
        -1px -1px 2px rgba(255,255,255,0.8);
    animation: pulseGravity 2s ease-in-out infinite;
    cursor: pointer;
}

@keyframes pulseGravity {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.9;
    }
    50% { 
        transform: scale(1.2);
        opacity: 1;
    }
}

.truck-center {
    position: absolute;
    z-index: 999;
    pointer-events: none;
}

/* Balance Status Indicator */
#balance-status {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
    font-size: 0.9rem;
    border: 2px solid;
    background: rgba(255,255,255,0.8);
    transition: all 0.3s ease;
}

/* Background Media */
body.has-background {
    position: relative;
}

body.has-background::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    opacity: 0.6;
}

.background-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 0.6;
}

/* Print Styles */
.print-area {
    display: none;
}

body.printing .print-area {
    display: block;
}



.settings-button:hover {
    transform: translateY(-2px) rotate(45deg);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.settings-button:active {
    transform: translateY(0px) rotate(90deg);
    transition: transform 0.1s ease;
}

.settings-button.clicked {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

.settings-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.settings-panel.show {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.settings-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: settingsSlideIn 0.3s ease;
    overflow: hidden;
}

.settings-header {
    background: linear-gradient(45deg, #3498db, #2ecc71);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.settings-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.settings-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.settings-option {
    padding: 20px;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-option:last-child {
    border-bottom: none;
}

.settings-option label {
    font-weight: 600;
    color: #2c3e50;
    margin-right: 15px;
}

.settings-option select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.settings-option select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

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

/* Mobile Settings Adjustments */
@media (max-width: 768px) {
    .settings-button {
        width: 40px;
        height: 40px;
        top: 15px;
    }
    
    /* Landing page: top-right, App page: top-left */
    body[data-page="landing"] .settings-button,
    .settings-button[data-position="right"] {
        right: 15px;
        left: auto;
    }
    
    .settings-button[data-position="left"] {
        left: 15px;
        right: auto;
    }
    
    .settings-icon {
        font-size: 18px;
    }
    
    .settings-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .settings-option {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 15px;
    }
    
    .settings-option label {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .settings-option select {
        min-width: auto;
        width: 100%;
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Ad Banner System */
.ad-banner {
    position: fixed;
    z-index: 100;
    display: none;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid #e1e8ed;
}

.ad-banner.visible {
    display: block;
}

.ad-banner img, .ad-banner video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.ad-banner video {
    background: #f8f9fa;
}

/* Left sidebar ad */
.ad-left {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: 600px;
}

/* Right sidebar ad */
.ad-right {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: 600px;
}

/* Bottom banner ad */
.ad-bottom {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 728px;
    height: 90px;
}

/* Responsive ad adjustments */
@media (max-width: 1400px) {
    .ad-left, .ad-right {
        width: 100px;
        height: 500px;
    }
    
    .ad-bottom {
        width: 600px;
        height: 80px;
    }
}

@media (max-width: 1200px) {
    .ad-left, .ad-right {
        display: none !important;
    }
    
    .ad-bottom {
        width: 500px;
        height: 70px;
    }
}

@media (max-width: 768px) {
    .ad-bottom {
        width: 90%;
        max-width: 400px;
        height: 60px;
    }
}