/* Enhanced Nativ Green Technology Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #2d5a27 0%, #4a7c59 50%, #6b8e23 100%);
    min-height: 100vh;
    color: #2c3e50;
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    background: linear-gradient(180deg, #ffffff 0%, #f8faf8 100%);
    min-height: 100vh;
    box-shadow: 0 0 40px rgba(45, 90, 39, 0.2);
    position: relative;
    overflow: hidden;
}

/* Header Styles with Nativ Logo */
.app-header {
    background: linear-gradient(135deg, #2d5a27 0%, #4a7c59 100%);
    color: white;
    padding: 25px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="leaves" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23leaves)"/></svg>');
    opacity: 0.3;
}

.logo-container {
    position: relative;
    z-index: 2;
    margin-bottom: 20px;
}

.nativ-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.logo-icon {
    position: relative;
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nativ-logo-img {
    width: auto;
    height: auto;
    max-width: 300px;
    max-height: 120px;
    object-fit: contain;
    filter: brightness(1.1) contrast(1.1);
    transition: transform 0.3s ease;
    margin-bottom: 15px;
}

.nativ-logo-img:hover {
    transform: scale(1.05);
}

.fallback-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.nativ-text-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 25px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.nativ-brand {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.nativ-tagline {
    font-size: 10px;
    color: #a8e6cf;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 2px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.brand-name {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    text-align: center;
    margin-top: 20px;
}

.tagline {
    font-size: 10px;
    color: #a8e6cf;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 2px;
}

.app-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
    color: #ffffff;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
    color: #a8e6cf;
}

.powered-by {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 0;
    font-style: italic;
    position: relative;
    z-index: 2;
    color: #a8e6cf;
}

/* Camera Section */
.camera-section {
    padding: 25px 20px;
    background: #ffffff;
}

.camera-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(45, 90, 39, 0.15);
    margin-bottom: 25px;
    border: 3px solid #e8f5e8;
}

#cameraStream {
    width: 100%;
    height: 320px;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
    background: #000;
}

#captureCanvas {
    display: none;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(45, 90, 39, 0.2);
    color: white;
    text-align: center;
}

.focus-frame {
    width: 220px;
    height: 220px;
    border: 3px solid #4caf50;
    border-radius: 20px;
    margin-bottom: 20px;
    animation: greenGlow 2s ease-in-out infinite alternate;
    position: relative;
}

.focus-frame::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 1px solid #a8e6cf;
    border-radius: 20px;
    animation: greenGlow 2s ease-in-out infinite alternate-reverse;
}

@keyframes greenGlow {
    from { box-shadow: 0 0 25px rgba(76, 175, 80, 0.6); }
    to { box-shadow: 0 0 35px rgba(76, 175, 80, 0.9); }
}

.camera-hint {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.ai-info {
    font-size: 12px;
    opacity: 0.9;
    background: rgba(45, 90, 39, 0.8);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(168, 230, 207, 0.3);
}

/* Camera Controls */
.camera-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-capture, .btn-upload, .btn-permission {
    flex: 1;
    min-width: 140px;
    padding: 16px 20px;
    border: none;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.btn-capture {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-capture::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;
}

.btn-capture:hover::before {
    left: 100%;
}

.btn-upload {
    background: #f8faf8;
    color: #2d5a27;
    border: 2px solid #e8f5e8;
    box-shadow: 0 4px 15px rgba(45, 90, 39, 0.1);
}

.btn-permission {
    background: #ff6b6b;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-capture:hover, .btn-upload:hover, .btn-permission:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(45, 90, 39, 0.2);
}

/* Preview Section */
.preview-section {
    padding: 25px 20px;
    background: #ffffff;
}

.preview-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(45, 90, 39, 0.15);
    margin-bottom: 25px;
    border: 3px solid #e8f5e8;
}

#previewImage {
    width: 100%;
    height: 320px;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
}

.preview-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
}

.btn-retake {
    background: rgba(45, 90, 39, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-retake:hover {
    background: rgba(45, 90, 39, 1);
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(45, 90, 39, 0.4);
}

.btn-analyze {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-analyze::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;
}

.btn-analyze:hover::before {
    left: 100%;
}

.btn-analyze:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(76, 175, 80, 0.4);
}

.btn-new-photo {
    width: 100%;
    padding: 16px;
    background: #f8faf8;
    color: #2d5a27;
    border: 2px solid #e8f5e8;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(45, 90, 39, 0.1);
}

.btn-new-photo:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(45, 90, 39, 0.15);
    background: #e8f5e8;
    border-color: #4caf50;
}

/* Loading Section */
.loading-section {
    padding: 50px 20px;
    text-align: center;
    background: #ffffff;
}

.loader {
    width: 70px;
    height: 70px;
    border: 4px solid #e8f5e8;
    border-top: 4px solid #4caf50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.2);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-section p {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #2d5a27;
}

.loading-sub {
    font-size: 14px;
    color: #4a7c59;
    margin-bottom: 35px;
}

.ai-progress {
    display: flex;
    justify-content: space-around;
    margin-top: 35px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #4a7c59;
}

.progress-step i {
    font-size: 18px;
    color: #4caf50;
    animation: pulse 2s infinite;
}

/* Results Section */
.results-section {
    padding: 25px 20px;
    background: #ffffff;
}

.surface-info {
    text-align: center;
    margin-bottom: 35px;
    padding: 25px;
    background: linear-gradient(135deg, #f8faf8 0%, #e8f5e8 100%);
    border-radius: 20px;
    border: 2px solid #d4edda;
}

.surface-info h2 {
    font-size: 22px;
    margin-bottom: 18px;
    color: #2d5a27;
}

.surface-type {
    margin-bottom: 18px;
}

.surface-type-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 26px;
    font-weight: 700;
    color: #4caf50;
}

.surface-type-main i {
    font-size: 30px;
    color: #4caf50;
}

.detection-method {
    font-size: 12px;
    color: #4a7c59;
    background: rgba(76, 175, 80, 0.1);
    padding: 6px 16px;
    border-radius: 15px;
    display: inline-block;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.confidence {
    text-align: center;
}

.confidence-bar {
    width: 100%;
    height: 10px;
    background: #e8f5e8;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid #d4edda;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50 0%, #45a049 100%);
    transition: width 0.5s ease;
    border-radius: 5px;
}

.confidence-text {
    font-size: 14px;
    font-weight: 600;
    color: #2d5a27;
    margin-bottom: 6px;
}

.analysis-details {
    font-size: 11px;
    color: #4a7c59;
    background: rgba(45, 90, 39, 0.05);
    padding: 6px 12px;
    border-radius: 10px;
    display: inline-block;
    border: 1px solid rgba(45, 90, 39, 0.1);
}

/* Recommendations */
.recommendations {
    margin-bottom: 35px;
}

.recommendations h3 {
    font-size: 20px;
    margin-bottom: 18px;
    color: #2d5a27;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recommendations h3 i {
    color: #4caf50;
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8faf8 100%);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(45, 90, 39, 0.08);
    transition: all 0.3s ease;
    border: 2px solid #e8f5e8;
}

.product-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(45, 90, 39, 0.15);
    border-color: #4caf50;
}

.product-icon {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.product-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #2d5a27;
}

.product-info p {
    font-size: 14px;
    color: #4a7c59;
    line-height: 1.5;
}

/* Cleaning Tips */
.cleaning-tips {
    margin-bottom: 35px;
}

.cleaning-tips h3 {
    font-size: 20px;
    margin-bottom: 18px;
    color: #2d5a27;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cleaning-tips h3 i {
    color: #4caf50;
}

.tips-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 16px;
    background: linear-gradient(135deg, #f8faf8 0%, #e8f5e8 100%);
    border-radius: 12px;
    border-left: 4px solid #4caf50;
    box-shadow: 0 2px 10px rgba(45, 90, 39, 0.05);
}

.tip-item i {
    color: #4caf50;
    font-size: 18px;
    margin-top: 2px;
}

.tip-item span {
    font-size: 14px;
    color: #2d5a27;
    line-height: 1.6;
}

/* Buttons */
.btn-new-scan {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-new-scan::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;
}

.btn-new-scan:hover::before {
    left: 100%;
}

.btn-new-scan:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(76, 175, 80, 0.4);
}

/* Error Section */
.error-section {
    padding: 50px 20px;
    text-align: center;
    background: #ffffff;
}

.error-section i {
    font-size: 52px;
    color: #ff6b6b;
    margin-bottom: 25px;
}

.error-section h3 {
    font-size: 22px;
    margin-bottom: 18px;
    color: #2d5a27;
}

.error-section p {
    font-size: 16px;
    color: #4a7c59;
    margin-bottom: 35px;
    line-height: 1.6;
}

.btn-retry {
    padding: 18px 35px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.btn-retry:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.4);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Debug Section */
.debug-section {
    padding: 25px 20px;
    background: #f8faf8;
    border-top: 2px solid #e8f5e8;
}

.debug-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #2d5a27;
}

/* Responsive Design */
@media (max-width: 480px) {
    .app-container {
        max-width: 100%;
        box-shadow: none;
    }
    
    .camera-controls {
        flex-direction: column;
    }
    
    .btn-capture, .btn-upload, .btn-permission {
        min-width: auto;
    }
    
    .ai-progress {
        flex-direction: column;
        gap: 18px;
    }
    
    .product-item {
        flex-direction: column;
        text-align: center;
    }
    
    .product-icon {
        align-self: center;
    }
    
    .nativ-logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .nativ-logo-img {
        width: auto;
        height: auto;
        max-width: 220px;
        max-height: 90px;
        object-fit: contain;
    }
    
    .brand-name {
        font-size: 24px;
        text-align: center;
        width: 100%;
    }
    
    .logo-text {
        align-items: center;
        text-align: center;
        width: 100%;
    }
    
    .tagline {
        text-align: center;
        width: 100%;
    }
}

/* Enhanced Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-section {
    animation: slideIn 0.6s ease-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

 