* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    min-height: 100vh;
    color: #e0e0e0;
    padding-bottom: 40px;
}
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.logo {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #4ecdc4, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}
.back-link {
    color: #a0a0a0;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}
.back-link:hover { color: #4ecdc4; }
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
}
h1 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 8px;
    color: #fff;
}
.subtitle {
    text-align: center;
    color: #a0a0a0;
    margin-bottom: 30px;
    font-size: 1rem;
}
.card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}
.form-group { margin-bottom: 20px; }
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #ccc;
}
select, .text-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s;
}
select:focus, .text-input:focus, textarea:focus {
    outline: none;
    border-color: #4ecdc4;
}
select option { background: #1a1a2e; color: #fff; }
textarea {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.3);
    color: #e0e0e0;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
}
.file-upload {
    border: 2px dashed rgba(255,255,255,0.3);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}
.file-upload:hover { border-color: #4ecdc4; background: rgba(78,205,196,0.05); }
.file-upload.has-file { border-color: #4ecdc4; background: rgba(78,205,196,0.1); }
.file-upload input { display: none; }
.file-upload-text { font-size: 1.1rem; color: #a0a0a0; }
.file-upload-icon { font-size: 3rem; margin-bottom: 10px; }
.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-primary {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: #fff;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(78,205,196,0.3);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-download {
    background: rgba(78,205,196,0.2);
    border: 1px solid #4ecdc4;
    color: #4ecdc4;
    padding: 10px 20px;
    width: auto;
    display: inline-block;
    margin: 5px;
    font-size: 0.9rem;
}
.btn-download:hover { background: rgba(78,205,196,0.3); }
.status {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    display: none;
}
.status.loading { display: block; background: rgba(255,193,7,0.1); border: 1px solid rgba(255,193,7,0.3); color: #ffc107; }
.status.success { display: block; background: rgba(78,205,196,0.1); border: 1px solid rgba(78,205,196,0.3); color: #4ecdc4; }
.status.error { display: block; background: rgba(255,82,82,0.1); border: 1px solid rgba(255,82,82,0.3); color: #ff5252; }
.result { display: none; margin-top: 20px; }
.result.show { display: block; }
.result h3 { margin-bottom: 10px; color: #4ecdc4; }
.result textarea { min-height: 200px; }
.downloads { margin-top: 15px; text-align: center; }
.spinner {
    display: inline-block; width: 20px; height: 20px;
    border: 3px solid rgba(255,193,7,0.3); border-radius: 50%;
    border-top-color: #ffc107; animation: spin 1s linear infinite;
    margin-right: 10px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
.info-text { font-size: 0.85rem; color: #888; margin-top: 5px; }
video { width: 100%; border-radius: 8px; margin-top: 15px; max-height: 300px; }
input[type="range"] {
    -webkit-appearance: none; height: 6px; border-radius: 3px;
    background: rgba(255,255,255,0.2); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 18px; height: 18px;
    border-radius: 50%; background: #4ecdc4; cursor: pointer;
}
@media (max-width: 768px) {
    h1 { font-size: 1.6rem; }
    .navbar { padding: 15px 20px; }
    .card { padding: 20px; }
}


/* Mobile buttons for camera/gallery */
.mobile-buttons {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.btn-mobile {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 8px;
    background: rgba(168, 85, 247, 0.1);
    color: #c084fc;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}
.btn-mobile:hover, .btn-mobile:active {
    background: rgba(168, 85, 247, 0.25);
    border-color: #a855f7;
    transform: scale(0.98);
}

/* PWA install prompt */
.install-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    background: rgba(78, 205, 196, 0.95);
    color: #000;
    text-align: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}
.install-banner button {
    margin-left: 10px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #000;
    color: #4ecdc4;
    font-weight: 600;
    cursor: pointer;
}

/* Better touch targets for mobile */
@media (max-width: 768px) {
    .btn { padding: 16px; font-size: 1rem; }
    .btn-download { padding: 12px 16px; }
    select, .text-input { padding: 14px 16px; font-size: 16px; }
    textarea { font-size: 16px; padding: 14px; }
    .file-upload { padding: 30px 20px; }
    .mobile-buttons { display: flex; }
}
@media (min-width: 769px) {
    .mobile-buttons { display: none; }
}

/* Safe area for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
    .navbar { padding-top: calc(20px + env(safe-area-inset-top)); }
    body { padding-bottom: env(safe-area-inset-bottom); }
}


/* Searchable autocomplete dropdown */
.autocomplete-wrapper {
    position: relative;
}
.autocomplete-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.2);
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    color: #e0e0e0;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s;
}
.autocomplete-item:hover, .autocomplete-item:active {
    background: rgba(78, 205, 196, 0.15);
    color: #4ecdc4;
}
.autocomplete-item:last-child {
    border-bottom: none;
}
