* {
    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, #667eea 0%, #764ba2 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: 30px;
    color: white;
}

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

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

.ad-container {
    margin: 20px 0;
    text-align: center;
}

.ad-banner {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    padding: 15px;
    border-radius: 8px;
    color: #6c757d;
    margin: 0 auto;
}

/* Desktop ad - show by default, hide on mobile */
.ad-desktop {
    display: block;
    max-width: 728px;
    min-height: 90px;
}

/* Mobile ad - hide by default, show on mobile */
.ad-mobile {
    display: none;
    max-width: 320px;
    min-height: 50px;
}

/* Switch ads on mobile */
@media (max-width: 768px) {
    .ad-desktop {
        display: none;
    }
    .ad-mobile {
        display: block;
    }
}

.ad-placeholder {
    background: rgba(255,255,255,0.1);
    border: 2px dashed rgba(255,255,255,0.3);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin: 0 auto;
    max-width: 728px;
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 600px;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #e9ecef;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #764ba2;
    background: #e3f2fd;
    transform: scale(1.02);
}

.upload-icon {
    width: 80px;
    height: 80px;
    color: #667eea;
    margin-bottom: 20px;
}

.upload-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.upload-content p {
    color: #666;
    margin-bottom: 10px;
}

.file-types {
    font-size: 0.9rem;
    color: #888;
}

.progress-container {
    margin-top: 20px;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: #666;
    font-size: 0.9rem;
}

.result-container {
    margin-top: 20px;
}

.success-message h3 {
    color: #28a745;
    margin-bottom: 20px;
    text-align: center;
}

.image-link {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.image-link input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #f8f9fa;
}

.image-link button {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.image-link button:hover {
    background: #764ba2;
}

.expiry-note {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

/* View page styles */
.view-header {
    text-align: center;
    margin-bottom: 20px;
    color: white;
}

.view-header h1 {
    font-size: 2rem;
}

.view-main {
    flex: 1;
}

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

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

.image-info p {
    margin-bottom: 10px;
    color: #555;
}

.share-section {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.share-section input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 0.9rem;
}

.share-section button {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.share-section button:hover {
    background: #764ba2;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .upload-container {
        padding: 20px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .upload-icon {
        width: 60px;
        height: 60px;
    }
    
    .image-link, .share-section {
        flex-direction: column;
    }
    
    .ad-placeholder {
        padding: 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .upload-content h3 {
        font-size: 1.2rem;
    }
    
    .upload-container {
        padding: 15px;
    }
}

.image-container {
    max-width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.image-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 10px;
}

/* Mobile-specific fixes */
@media (max-width: 768px) {
    .image-container {
        padding: 5px;
        margin: 10px;
        border-radius: 10px;
    }
    
    .image-container img {
        width: 100%;
        max-width: none;
        border-radius: 8px;
    }
    
    /* Ensure viewport is properly set */
    .container {
        padding: 10px;
    }
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    .image-container img {
        max-height: 70vh; /* Limit height on iOS */
    }
}

