:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    padding: 20px;
    padding-top: 65px;
}

/* ── Back Button ── */
.back-button {
    position: fixed;
    top: 15px;
    left: 20px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    z-index: 1000;
    text-decoration: none;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.back-button:hover {
    background: white;
    transform: translateX(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* ── Breadcrumb ── */
.breadcrumb-nav {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 10px;
}

.breadcrumb {
    list-style: none;
    display: flex;
    gap: 8px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    margin-left: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

.breadcrumb a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
    color: white;
    font-weight: 600;
}

/* ── Tool Switcher ── */
.tool-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 10px 16px;
    margin-bottom: 16px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.tool-switcher-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
    white-space: nowrap;
}

.tool-switch-btn {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-block;
}

.tool-switch-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.tool-switch-btn.active {
    background: white;
    color: var(--primary-color);
    font-weight: 700;
    border-color: white;
    pointer-events: none;
}

/* ── Container ── */
.container {
    max-width: 1000px;
    margin: 0 auto 40px;
}

.header {
    text-align: center;
    margin-bottom: 25px;
}

.header h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

/* ── Badges ── */
.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.badge {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge.success {
    background: #d4edda;
    color: #155724;
}

.badge.info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ── Main Card ── */
.main-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ── Two column ── */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* ── Input Section ── */
.input-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
}

.input-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.95rem;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: white;
    color: #333;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ── Upload / Dropzone ── */
.dropzone {
    border: 2px dashed #c0c8e8;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.06), rgba(118, 75, 162, 0.04));
    padding: 28px 20px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.08);
    transform: translateY(-1px);
}

.dropzone input {
    display: none;
}

.dropzone .dz-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.12));
    border: 1px solid rgba(102, 126, 234, 0.2);
    color: var(--primary-color);
    font-size: 1.3rem;
}

.dropzone strong {
    font-size: 1rem;
    color: #333;
}

.dropzone span {
    color: #888;
    font-size: 0.88rem;
    line-height: 1.5;
    max-width: 340px;
}

/* ── File Meta Chips ── */
.file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.meta-chip {
    padding: 7px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    background: #f8f9fa;
    color: #555;
    font-size: 0.85rem;
}

/* ── Status ── */
.status {
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    background: #f8f9fa;
    color: #777;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
}

.status strong {
    color: #333;
}

.status.success {
    border-color: #b8dfc8;
    background: #f0faf4;
    color: #2d6a4f;
}

.status.warn {
    border-color: #f5d98a;
    background: #fffbec;
    color: #856404;
}

.status.error {
    border-color: #f5b8b8;
    background: #fff0f0;
    color: #842029;
}

/* ── Preview Section ── */
.preview-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.preview-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.3rem;
}

.preview-box {
    background: white;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/10;
    display: grid;
    place-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
}

.preview-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.preview-placeholder {
    padding: 20px;
    color: #999;
    font-size: 0.9rem;
    line-height: 1.6;
}

.preview-overlay {
    position: absolute;
    inset: auto 10px 10px 10px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
}

.preview-badge {
    background: rgba(0, 0, 0, 0.55);
    color: white;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.78rem;
    backdrop-filter: blur(6px);
}

/* ── Stats (camera/gps cards) ── */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.stat-card {
    background: white;
    border: 1px solid #e8ecf5;
    border-radius: 10px;
    padding: 12px;
    text-align: left;
}

.stat-card .s-label {
    color: #999;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 5px;
}

.stat-card .s-value {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.4;
    word-break: break-word;
}

.stat-card .s-hint {
    display: block;
    margin-top: 5px;
    color: #aaa;
    font-size: 0.8rem;
    line-height: 1.4;
    word-break: break-word;
}

/* ── Metadata Panel ── */
.metadata-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.panel-header h3 {
    color: #333;
    font-size: 1.3rem;
}

.tag-count {
    background: #e8ecf5;
    color: var(--primary-color);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
}

.meta-search {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #333;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.meta-search:focus {
    outline: none;
    border-color: var(--primary-color);
}

.meta-search::placeholder {
    color: #bbb;
}

.meta-list {
    display: grid;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 2px;
}

.meta-item {
    display: grid;
    grid-template-columns: minmax(160px, 0.45fr) 1fr;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e8ecf5;
    background: white;
    align-items: start;
    font-size: 0.88rem;
}

.meta-item .k {
    font-weight: 700;
    color: #333;
    word-break: break-word;
}

.meta-item .v {
    color: #777;
    word-break: break-word;
    white-space: pre-wrap;
    line-height: 1.5;
}

.empty-state {
    border: 1px dashed #ddd;
    border-radius: 10px;
    padding: 20px;
    color: #bbb;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.6;
    background: white;
}

/* ── Action Buttons ── */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.action-button {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.action-button.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.action-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.action-button.secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #ddd;
}

.action-button.secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.action-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
}

.maps-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
}

.maps-link:hover {
    text-decoration: underline;
}

/* ── SEO Content ── */
.seo-content {
    margin-top: 30px;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    color: #444;
    line-height: 1.8;
}

.seo-content h2 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin: 24px 0 10px;
}

.seo-content h2:first-child {
    margin-top: 0;
}

.seo-content p {
    margin-bottom: 12px;
    font-size: 0.97rem;
}

.seo-content ul {
    margin: 8px 0 14px 20px;
}

.seo-content ul li {
    margin-bottom: 6px;
    font-size: 0.95rem;
}

/* ── Format Table ── */
.format-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
    font-size: 0.9rem;
}

.format-table th {
    background: #f0f3ff;
    color: var(--primary-color);
    padding: 10px 14px;
    text-align: left;
    font-weight: 700;
}

.format-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    color: #555;
}

.format-table tr:last-child td {
    border-bottom: none;
}

.format-table tr:hover td {
    background: #fafafa;
}

/* ── FAQ ── */
.faq-section {
    margin-top: 30px;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 24px;
    color: #2c3e50;
    font-size: 1.5rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.faq-item {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
}

.faq-item summary {
    font-weight: 600;
    color: #333;
    cursor: pointer;
    padding: 5px 0;
}

.faq-item summary:hover {
    color: var(--primary-color);
}

.faq-item p {
    margin-top: 10px;
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ── Related Tools ── */
.related-tools {
    margin-top: 30px;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.related-tools h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.4rem;
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.related-link {
    display: inline-block;
    padding: 10px 20px;
    background: #e9ecef;
    color: #333;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.related-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* ── Footer ── */
footer {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
}

footer a {
    color: white;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background: #333;
    color: white;
    border-radius: 8px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--error-color);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }

    .back-button {
        top: 10px;
        left: 10px;
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .two-column {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }

    .related-links {
        flex-direction: column;
        align-items: stretch;
    }

    .related-link {
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .meta-item {
        grid-template-columns: 1fr;
    }

    .tool-switcher {
        gap: 6px;
        padding: 8px 12px;
    }

    .tool-switch-btn {
        font-size: 0.78rem;
        padding: 5px 10px;
    }
}