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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #003B75;
    min-height: 100vh;
    padding: 20px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Be Vietnam Pro', sans-serif;
}

@media (min-width: 1920px) {
    body {
        padding: 30px;
    }
}

.container {
    max-width: 90%;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 1920px) {
    .container {
        max-width: 1800px;
    }
}

@media (min-width: 2560px) {
    .container {
        max-width: 2400px;
    }
}

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

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.upload-section {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    transition: border-color 0.3s;
}

.upload-section.dragover {
    border-color: #667eea;
    background: #f8f9ff;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
    margin: 20px 0;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-label {
    display: inline-block;
    padding: 12px 30px;
    background: #667eea;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.file-input-label:hover {
    background: #5a67d8;
}

.mode-selector {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.mode-selector label {
    cursor: pointer;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.mode-selector label:hover {
    background: #f7fafc;
    border-color: #667eea;
}

.mode-selector input[type="radio"] {
    margin-right: 10px;
}

.mode-selector input[type="radio"]:checked + label {
    background: #f7fafc;
    border-color: #667eea;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    margin: 5px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
}

.btn-danger {
    background: #f56565;
    color: white;
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    color: #718096;
    margin-top: 5px;
}

.message {
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    display: none;
}

.message.success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.message.error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
    display: none;
}

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

/* Tab Styles */
.tab-container {
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 0;
}

.tab-button {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    border-radius: 8px 8px 0 0;
}

.tab-button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

.tab-button.active {
    color: #4a5568;
    border-bottom-color: #667eea;
    background: #ffffff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Responsive Grid Container */
.grid-container {
    width: 100%;
    height: 70vh;
    min-height: 500px;
    max-height: 1200px;
}

@media (min-width: 1920px) {
    .grid-container {
        height: 75vh;
        max-height: 1400px;
    }
}

@media (min-width: 2560px) {
    .grid-container {
        height: 80vh;
        max-height: 1600px;
    }
}

/* External Link Button */
.external-link-btn {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.external-link-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    margin: 0;
    color: #2d3748;
}

.modal-close {
    color: #a0aec0;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover,
.modal-close:focus {
    color: #4a5568;
}

.modal-body {
    padding: 30px;
}

/* Footer */
.tiny-footer {
    text-align: center;
    color: #ffffff;
    font-size: 11px;
    padding: 20px;
    margin-top: 30px;
    font-style: italic;
}