/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Ad Banners */
.ad-banner {
    margin: 1rem 0;
    text-align: center;
}

.ad-placeholder {
    background: #e9ecef;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    color: #6c757d;
    font-weight: 500;
}

.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* Upload Section */
.upload-section {
    margin-bottom: 2rem;
}

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

.upload-area {
    background: white;
    border: 3px dashed #dee2e6;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background-color: #f0f4ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-area h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.upload-area p {
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.supported-formats {
    font-size: 0.9rem;
    color: #868e96;
    margin-bottom: 1.5rem;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Content Area */
.content-area {
    margin-top: 2rem;
}

.content-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Image Section */
.image-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.image-section h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.3rem;
}

.image-container {
    text-align: center;
    margin-bottom: 1rem;
}

#image-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.image-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.image-info p {
    margin-bottom: 0.5rem;
}

.image-info p:last-child {
    margin-bottom: 0;
}

/* Metadata Section */
.metadata-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.metadata-section h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.3rem;
}

.metadata-container {
    max-height: 400px;
    overflow-y: auto;
}

/* New Metadata Display Format */
.metadata-sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Metadata Summary Card */
.metadata-summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow: hidden;
    color: white;
}

.metadata-summary-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.metadata-summary-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.metadata-summary-content {
    padding: 1rem;
}

.summary-item {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.summary-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.metadata-section-card {
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.metadata-section-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metadata-section-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.metadata-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.metadata-section-content {
    padding: 1rem;
}

.metadata-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.metadata-item:last-child {
    border-bottom: none;
}

.metadata-item-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.metadata-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.metadata-name {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.metadata-item-value {
    flex: 1;
    text-align: right;
    color: #6c757d;
    font-size: 0.9rem;
    word-break: break-word;
    margin-left: 1rem;
}

/* Legacy table styles for fallback */
.metadata-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.metadata-table th,
.metadata-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.metadata-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.metadata-table tr:hover {
    background-color: #f8f9fa;
}

.metadata-category {
    background: #e9ecef;
    padding: 0.5rem 1rem;
    margin: 1rem 0 0.5rem 0;
    border-radius: 6px;
    font-weight: 600;
    color: #495057;
}

.no-metadata {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.btn-outline {
    background: transparent;
    color: #6c757d;
    border: 2px solid #dee2e6;
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

/* Privacy Notice */
.privacy-notice {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 2rem;
}

.privacy-notice p {
    margin: 0;
    color: #0056b3;
    font-weight: 500;
}

/* Footer */
.footer {
    background: #343a40;
    color: white;
    padding: 3rem 0 1rem 0;
    margin-top: 3rem;
}

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

.footer-section h4 {
    margin-bottom: 1rem;
    color: #fff;
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #495057;
    padding-top: 1rem;
    text-align: center;
    color: #adb5bd;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .desktop-only {
        display: none;
    }
    
    .mobile-only {
        display: block;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    /* Mobile metadata display */
    .metadata-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .metadata-item-value {
        text-align: left;
        margin-left: 0;
        padding-left: 1.6rem;
    }
    
    .metadata-section-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .metadata-count {
        align-self: flex-end;
    }
    
    /* Mobile SEO content */
    .seo-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .seo-main h2 {
        font-size: 1.6rem;
    }
    
    .seo-main h3 {
        font-size: 1.2rem;
    }
    
    .seo-sidebar {
        position: static;
    }
}

@media (min-width: 769px) {
    .content-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success/Error/Info Messages */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 400px;
    word-wrap: break-word;
}

.message-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.message-error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.message-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* GPS Link Styling */
.gps-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.gps-link:hover {
    text-decoration: underline;
}

/* GPS Map Preview */
.gps-map-preview {
    margin-top: 1rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.gps-map-preview iframe {
    border: none;
    width: 100%;
    height: 200px;
}

/* Location Data Section Enhancement */
.metadata-section-card:has(.metadata-item:has(.gps-map-preview)) {
    border: 2px solid #28a745;
}

.metadata-section-card:has(.metadata-item:has(.gps-map-preview)) .metadata-section-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

/* Scrollbar Styling */
.metadata-container::-webkit-scrollbar {
    width: 8px;
}

.metadata-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.metadata-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.metadata-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* SEO Content Section */
.seo-content {
    background: #f8f9fa;
    padding: 3rem 0;
    margin: 2rem 0;
}

.seo-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.seo-main h2 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.seo-main h3 {
    color: #495057;
    font-size: 1.4rem;
    margin: 2rem 0 1rem 0;
    line-height: 1.4;
}

.seo-main p {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.seo-main ul,
.seo-main ol {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.seo-main li {
    margin-bottom: 0.5rem;
}

.seo-main strong {
    color: #495057;
    font-weight: 600;
}

.seo-sidebar {
    position: sticky;
    top: 2rem;
}

.seo-box {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.seo-box h4 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.seo-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.seo-box li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f3f4;
    color: #6c757d;
    font-size: 0.9rem;
}

.seo-box li:last-child {
    border-bottom: none;
}

.seo-box strong {
    color: #495057;
    font-weight: 600;
}

/* Privacy and Terms Pages */
.privacy-content,
.terms-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto;
}

.privacy-content h2,
.terms-content h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.privacy-content h3,
.terms-content h3 {
    color: #495057;
    margin: 1.5rem 0 0.5rem 0;
    font-size: 1.3rem;
}

.privacy-content p,
.terms-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.privacy-content ul,
.terms-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.privacy-content li,
.terms-content li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.back-link {
    margin-top: 2rem;
    text-align: center;
}

.back-link .btn {
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
}

/* Sidebar Ad Styling */
.sidebar-ad {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.sidebar-ad .ad-placeholder {
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ad Content Styling */
.ad-content {
    text-align: center;
}

.ad-content p {
    margin-bottom: 0.5rem;
}

.ad-note {
    font-size: 0.8rem;
    color: #868e96;
    font-style: italic;
} 