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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: #4a5568;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
}

/* Main page large logo style */
.logo-main {
    width: auto;
    max-width: 400px;
    height: auto;
    display: block;
    margin: 0 auto 20px auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}

/* Responsive logo - adjust size on small screens */
@media (max-width: 768px) {
    .logo-main {
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .logo-main {
        max-width: 250px;
    }
}

.logo:hover, .logo-main:hover {
    transform: scale(1.05);
}

.header-text {
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Responsive design - vertical layout for logo and text on small screens */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-text {
        margin-left: 0;
        margin-top: 15px;
    }
    
    .container {
        padding: 10px;
    }
    
    .verification-section {
        padding: 20px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group input {
        margin-bottom: 10px;
        border-radius: 8px;
    }
    
    .input-group button {
        border-radius: 8px;
    }
    
    .result {
        padding: 15px;
    }
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.verification-section,
.result-section,
.stats-section,
.info-section,
.admin-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.verification-section h2,
.stats-section h2,
.info-section h2,
.admin-section h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.feature-item {
    text-align: center;
    padding: 20px;
    background: #f7fafc;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.feature-item h3 {
    color: #4a5568;
    margin-bottom: 10px;
}

.feature-item p {
    color: #666;
    line-height: 1.5;
}

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

.input-group input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.input-hint {
    margin-top: -15px;
    margin-bottom: 20px;
}

.input-hint p {
    font-size: 0.9rem;
    color: #666;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 6px;
    margin: 0;
}

.input-group button,
.stats-section button,
.actions button {
    padding: 15px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.input-group button:hover,
.stats-section button:hover,
.actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.result-card {
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
}

.result-card.authentic {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.result-card.fake {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.result-header h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.product-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
}

.label {
    font-weight: 600;
}

.value {
    font-weight: 700;
}

.authenticity-message {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
}

.error {
    background: #fed7d7;
    color: #c53030;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.error h3 {
    margin-bottom: 10px;
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.stats-content {
    margin-top: 20px;
}

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

.stats-card {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.stats-card h3 {
    color: #4a5568;
    margin-bottom: 15px;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.actions {
    text-align: center;
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .result-details {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 15px;
    }
}

/* Admin page styles */
.admin-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.admin-actions {
    display: flex;
    gap: 10px;
}

.admin-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.admin-actions button:first-child {
    background: #28a745;
    color: white;
}

.admin-actions button:first-child:hover {
    background: #218838;
}

.logout-btn {
    background: #dc3545 !important;
    color: white !important;
}

.logout-btn:hover {
    background: #c82333 !important;
}

.stats-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.stats-content {
    margin-top: 15px;
}

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

.overview-item {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.overview-item h3 {
    font-size: 2.5em;
    margin: 0 0 10px 0;
    font-weight: bold;
}

.overview-item p {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.9;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

.stats-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #007bff;
}

.stats-card h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.3em;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #dee2e6;
}

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

.stats-item span:first-child {
    font-weight: 500;
    color: #495057;
}

.stats-item span:last-child {
    color: #007bff;
    font-weight: bold;
}

.product-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    border: 1px solid #dee2e6;
}

.product-form h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.2em;
}

/* Excel import functionality styles */
.import-info {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #007bff;
}

.import-info p {
    margin: 0 0 10px 0;
    font-weight: bold;
    color: #0056b3;
}

.import-info ul {
    margin: 10px 0;
    padding-left: 20px;
}

.import-info li {
    margin: 5px 0;
    color: #495057;
}

.template-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 15px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.template-link:hover {
    background: #0056b3;
    text-decoration: none;
    color: white;
}

.btn-loading {
    display: none;
    align-items: center;
    gap: 8px;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #6c757d;
    margin-top: 10px;
}

/* File input style optimization */
.form-group input[type="file"] {
    padding: 10px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-group input[type="file"]:hover {
    border-color: #007bff;
    background: #e7f3ff;
}

.form-group input[type="file"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Enhanced error and success message styles */
.error, .success {
    padding: 12px 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
}

.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.success details {
    margin-top: 10px;
}

.success summary {
    cursor: pointer;
    font-weight: 600;
    color: #22543d;
}

.success summary:hover {
    color: #1a202c;
}

.success ul {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 10px;
    margin-top: 5px;
}

.success li {
    font-size: 0.9rem;
    margin-bottom: 3px;
}

/* iOS-style Animation Effects */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Verification Result Modal */
.verification-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.verification-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.8) translateY(50px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.verification-modal.show .modal-content {
    transform: scale(1) translateY(0);
}

/* Success Animation Stages */
.success-stage {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.success-stage.show {
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.6s ease forwards;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #48bb78, #38a169);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: pulse 2s infinite;
}

.success-icon::after {
    content: '✓';
    color: white;
    font-size: 40px;
    font-weight: bold;
}

.country-info {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-radius: 15px;
    border: 2px solid #e2e8f0;
}

.country-flag {
    font-size: 60px;
    margin-bottom: 15px;
    animation: slideInFromRight 0.8s ease;
}

/* Ensure SVG flag scales nicely inside the modal */
.country-flag .fi {
    display: inline-block;
    line-height: 1;
}
.country-text {
    font-size: 18px;
    color: #2d3748;
    font-weight: 600;
    line-height: 1.5;
}

.purchase-stats {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px;
    border-radius: 12px;
    margin-top: 15px;
    font-weight: 600;
}

/* Error Animation */
.error-stage {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s ease;
}

.error-stage.show {
    opacity: 1;
    transform: scale(1);
    animation: fadeInScale 0.5s ease forwards;
}

.error-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #f56565, #e53e3e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: pulse 2s infinite;
}

.error-icon::after {
    content: '✕';
    color: white;
    font-size: 40px;
    font-weight: bold;
}

.error-message {
    color: #c53030;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.error-details {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Close Button */
.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #333;
}

/* Loading Animation */
.loading-stage {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.4s ease;
}

.loading-stage.show {
    opacity: 1;
    transform: scale(1);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    color: #666;
    font-size: 16px;
    font-weight: 500;
}

/* Responsive Design for Modal */
@media (max-width: 480px) {
    .modal-content {
        padding: 20px;
        margin: 20px;
    }
    
    .success-icon,
    .error-icon {
        width: 60px;
        height: 60px;
    }
    
    .success-icon::after,
    .error-icon::after {
        font-size: 30px;
    }
    
    .country-flag {
        font-size: 40px;
    }
    
    .country-text {
        font-size: 16px;
    }
}