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

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

.container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    max-width: 1000px;
    margin: 0 auto;
}

h1 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    text-align: center;
}

.subtitle {
    color: #666;
    margin-bottom: 2rem;
    text-align: center;
}

.address-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 2px solid #e9ecef;
}

.address-section h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-align: center;
}

.address-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

#address-input {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
}

#address-input:focus {
    border-color: #667eea;
}

.btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.btn:hover {
    background: #5a6fd8;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.coordinates {
    display: none;
    color: #666;
    font-size: 0.9rem;
    margin-top: 1rem;
    text-align: center;
}

.settings {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 2px solid #e9ecef;
}

.settings h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-align: center;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.setting-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.setting-item label {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.setting-item input {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
    font-size: 1rem;
}

.positions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.position-group {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s;
}

.position-group:hover {
    border-color: #667eea;
}

.position-group h4 {
    color: #333;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.position-group .setting-item {
    margin: 0;
}

.position-group .setting-item label {
    font-size: 0.8rem;
    color: #666;
}

.position-group .setting-item input {
    margin-top: 0.3rem;
    font-weight: bold;
}

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

.summary-card {
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    border: 2px solid #fdcb6e;
}

.summary-card h3 {
    color: #333;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.summary-card .value {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}

.summary-card .unit {
    color: #666;
    font-size: 0.9rem;
}

.data-table-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    position: relative;
}

.table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f3f4;
}

.table-scroll-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-scroll-wrapper::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 10px;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

.scroll-indicator {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: rgba(102, 126, 234, 0.8);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.7rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
}

.scroll-indicator.show {
    opacity: 1;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.data-table tr:nth-child(even) {
    background: #f8f9fa;
}

.data-table tr:hover {
    background: #e3f2fd;
}

.today {
    background: #fff3cd !important;
    font-weight: bold;
}

.past {
    color: #666;
}

.future {
    color: #333;
}

.day-type {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    display: inline-block;
    margin-left: 0.5rem;
}

.past-badge {
    background: #e9ecef;
    color: #6c757d;
}

.today-badge {
    background: #fff3cd;
    color: #856404;
}

.future-badge {
    background: #d1ecf1;
    color: #0c5460;
}

.production-bar {
    height: 20px;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    border-radius: 10px;
    margin: 0.5rem 0;
    position: relative;
    overflow: hidden;
}

.production-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.loading, .error {
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    text-align: center;
    display: none;
}

.loading {
    background: #e3f2fd;
    color: #1976d2;
}

.error {
    background: #ffebee;
    color: #c62828;
}

.info {
    text-align: center;
    color: #666;
    margin: 1rem 0;
}

.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip:hover .tooltiptext,
.tooltip:focus .tooltiptext,
.tooltip.active .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.tooltip {
    -webkit-tap-highlight-color: transparent;
}

.time-detail {
    font-size: 0.8rem;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .address-input-group {
        flex-direction: column;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .positions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .data-table {
        font-size: 0.8rem;
        min-width: 900px;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem 0.3rem;
        white-space: nowrap;
    }

    .data-table th:first-child,
    .data-table td:first-child {
        position: sticky;
        left: 0;
        background: white;
        z-index: 10;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }

    .data-table thead th:first-child {
        background: #667eea;
        z-index: 11;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }


    .tooltip .tooltiptext {
        width: 180px;
        margin-left: -90px;
        font-size: 0.7rem;
        padding: 6px 8px;
    }

    .tooltip:hover .tooltiptext {
        visibility: visible;
        opacity: 1;
    }

    .tooltip:active .tooltiptext {
        visibility: visible;
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .positions-grid {
        grid-template-columns: 1fr;
    }

    .summary-cards {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .summary-card {
        padding: 1rem;
    }

    .tooltip .tooltiptext {
        width: 160px;
        margin-left: -80px;
        font-size: 0.65rem;
        padding: 4px 6px;
    }

    .data-table {
        min-width: 1000px;
    }

    .data-table th,
    .data-table td {
        padding: 0.4rem 0.2rem;
        font-size: 0.7rem;
    }
}