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

:root {
    --primary-color: #4285f4;
    --primary-dark: #3367d6;
    --success-color: #34a853;
    --error-color: #ea4335;
    --warning-color: #fbbc04;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --border-color: #dadce0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.upload-section,
.loading-section,
.results-section,
.error-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.upload-box {
    margin-bottom: 30px;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-color);
    color: var(--text-secondary);
}

.upload-label:hover {
    border-color: var(--primary-color);
    background: rgba(66, 133, 244, 0.05);
    color: var(--primary-color);
}

.upload-label svg {
    margin-bottom: 15px;
    stroke: currentColor;
}

.upload-label span {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.upload-label small {
    font-size: 0.9rem;
    opacity: 0.7;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-top: 15px;
}

.file-info span {
    color: var(--text-primary);
    font-weight: 500;
}

.btn-remove {
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-remove:hover {
    background: #c5221f;
}

.info-box {
    background: #e8f0fe;
    border-left: 4px solid var(--primary-color);
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.info-box h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.info-box p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.info-box code {
    background: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85rem;
}

.divider {
    text-align: center;
    margin: 40px 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: var(--border-color);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.divider span {
    background: var(--bg-color);
    padding: 0 20px;
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
}

.manual-entry-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.manual-entry-section h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.address-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.address-input {
    flex: 1;
    min-width: 250px;
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.address-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.address-input-group .btn-primary {
    width: auto;
    min-width: 150px;
    margin: 0;
    white-space: nowrap;
}

.address-list {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.address-list h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.address-list ul {
    list-style: none;
    margin-bottom: 20px;
}

.address-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: background 0.2s;
}

.address-list-item:hover {
    background: #e8e8e8;
}

.address-list-item span {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.address-list-item .btn-remove-item {
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.address-list-item .btn-remove-item:hover {
    background: #c5221f;
}

.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: var(--shadow-hover);
}

.btn-primary:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.loading-section {
    text-align: center;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loadingText {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.results-section {
    margin-top: 0;
}

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

.results-header .stats {
    display: flex;
    gap: 30px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    margin: 0;
    flex-wrap: wrap;
}

.results-header .btn-primary {
    width: auto;
    margin: 0;
    min-width: 150px;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 800px;
    table-layout: auto;
}

thead {
    background: var(--bg-color);
    position: sticky;
    top: 0;
}

th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.coordinate-cell {
    vertical-align: middle;
}

.coordinate-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.coordinate-value {
    display: inline-block;
}

.copy-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.6;
}

.copy-btn:hover {
    background: var(--bg-color);
    color: var(--primary-color);
    opacity: 1;
}

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

.copy-btn svg {
    display: block;
}

tbody tr:hover {
    background: rgba(66, 133, 244, 0.03);
}

.status-ok {
    color: var(--success-color);
    font-weight: 500;
}

.status-error {
    color: var(--error-color);
    font-weight: 500;
}

.stats {
    display: flex;
    gap: 30px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-hover);
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.scroll-to-top.show {
    display: flex;
}

.scroll-to-top svg {
    stroke: white;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-value.success {
    color: var(--success-color);
}

.stat-value.error {
    color: var(--error-color);
}

.error-box {
    text-align: center;
    padding: 20px;
}

.error-box h3 {
    color: var(--error-color);
    margin-bottom: 15px;
}

.error-box p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .upload-section,
    .loading-section,
    .results-section,
    .error-section {
        padding: 20px;
    }

    .upload-label {
        padding: 40px 15px;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .results-header .stats {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 0;
        margin-bottom: 10px;
    }

    .results-header .stat-item {
        flex: 1;
        text-align: center;
        padding: 8px 4px;
    }

    .results-header .stat-label {
        font-size: 0.7rem;
        margin-bottom: 2px;
    }

    .results-header .stat-value {
        font-size: 1.2rem;
    }

    .results-header .btn-primary {
        width: 100%;
        margin-top: 10px;
        padding: 12px 20px;
    }

    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 8px 10px;
    }

    .coordinate-cell {
        gap: 6px;
    }

    .copy-btn {
        padding: 3px;
    }

    .copy-btn svg {
        width: 14px;
        height: 14px;
    }

    .stats {
        flex-direction: row;
        gap: 8px;
        padding: 12px 8px;
        justify-content: space-between;
    }

    .stat-item {
        flex: 1;
        text-align: center;
        padding: 4px;
    }

    .stat-label {
        font-size: 0.7rem;
        margin-bottom: 2px;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .address-input-group {
        flex-direction: column;
    }

    .address-input-group .address-input {
        width: 100%;
        min-width: 100%;
    }

    .address-input-group .btn-primary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.75rem;
    }

    .upload-label span {
        font-size: 1rem;
    }

    table {
        font-size: 0.8rem;
        min-width: 600px;
    }

    th, td {
        padding: 6px 8px;
    }
}

