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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Particles Background */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 8s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 1; }
    50% { transform: translateY(-20px) rotate(180deg); opacity: 0.7; }
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.title {
    font-size: 2.5em;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite ease-in-out;
}

.title i {
    color: #ff6b9d;
    margin: 0 15px;
    animation: bounce 1s infinite alternate;
}

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

@keyframes bounce {
    from { transform: translateY(0px); }
    to { transform: translateY(-5px); }
}

.subtitle {
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* Main Content */
.main-content {
    max-width: 600px;
    margin: 0 auto;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    
    /* Mobile touch support */
    -webkit-tap-highlight-color: rgba(255, 107, 157, 0.3);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.upload-area:hover {
    border-color: #ff6b9d;
    background: rgba(255, 107, 157, 0.1);
    transform: translateY(-2px);
}

.upload-area.drag-over {
    border-color: #ff6b9d;
    background: rgba(255, 107, 157, 0.2);
}

.upload-icon {
    font-size: 3em;
    color: #ff6b9d;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.upload-content h3 {
    color: white;
    font-size: 1.3em;
    margin-bottom: 10px;
    font-weight: 600;
}

.upload-content p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
}

.upload-btn {
    background: linear-gradient(135deg, #ff6b9d, #ff8a80);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
    
    /* Mobile optimization */
    -webkit-tap-highlight-color: rgba(255, 107, 157, 0.3);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    min-height: 44px; /* iOS minimum touch target */
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.6);
}

.upload-btn:active {
    transform: translateY(0px);
}

/* Preview Section */
.preview-section {
    text-align: center;
}

.image-preview {
    position: relative;
    margin-bottom: 30px;
}

.image-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.change-image-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.change-image-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

/* Karbit Button */
.karbit-action {
    margin-bottom: 30px;
}

.karbit-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 20px 40px;
    border-radius: 50px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    min-width: 250px;
}

.karbit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.karbit-btn:hover::before {
    left: 100%;
}

.karbit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

.karbit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading i {
    margin-right: 10px;
}

/* Result Section */
.result-section {
    margin-top: 30px;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.percentage-display {
    margin-bottom: 30px;
}

.percentage-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b9d, #ff8a80);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(255, 107, 157, 0.4);
    animation: scaleIn 0.8s ease-out;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.percentage-number {
    font-size: 2.2em;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.result-text h3 {
    color: white;
    font-size: 1.4em;
    margin-bottom: 15px;
    font-weight: 600;
}

.result-text p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 30px;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn, .retry-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 150px;
}

.share-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

.retry-btn {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.6);
}

/* Footer */
.footer {
    margin-top: 60px;
    text-align: center;
}

.footer-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
}

.footer-content i {
    color: #ff6b9d;
    margin: 0 5px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2em;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.social-links a:hover {
    color: #ff6b9d;
    transform: translateY(-2px);
    background: rgba(255, 107, 157, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2em;
    }
    
    .title i {
        margin: 0 8px;
    }
    
    .header-content {
        padding: 20px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .karbit-btn {
        padding: 18px 35px;
        font-size: 1.1em;
        min-width: 200px;
    }
    
    .percentage-circle {
        width: 120px;
        height: 120px;
    }
    
    .percentage-number {
        font-size: 1.8em;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .share-btn, .retry-btn {
        max-width: 200px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8em;
    }
    
    .upload-content h3 {
        font-size: 1.1em;
    }
    
    .karbit-btn {
        padding: 15px 30px;
        font-size: 1em;
        min-width: 180px;
    }
    
    .percentage-circle {
        width: 100px;
        height: 100px;
    }
    
    .percentage-number {
        font-size: 1.5em;
    }
    
    .result-card {
        padding: 30px 20px;
    }
}