:root {
    --primary-color: #8c9eff;
    --secondary-color: #B0BEC5;
    --background-dark: #1a1a1a;
    --background-darker: #121212;
    --text-color: #FFFFFF;
    --success-color: #4CAF50;
    --error-color: #f44336;
    --input-bg: #2d2d2d;
    --border-color: rgba(255, 255, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-dark);
    color: var(--text-color);
    line-height: 1.6;
    padding: 2rem;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--background-darker);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1, h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.section {
    background-color: var(--background-darker);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Input Styles */
input[type="text"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(140, 158, 255, 0.3);
}

label {
    color: var(--secondary-color);
    font-weight: 500;
    display: block;
    margin-bottom: 0.5rem;
}

/* Button Styles */
button {
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

button:hover {
    background-color: #9fa8da;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Camera Section */
.camera-container {
    position: relative;
    width: 100%;
    margin: 20px 0;
}

.camera-buttons {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 10px;
}

.take-picture-button {
    background-color: var(--success-color);
    padding: 12px 30px;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.take-picture-button.save {
    background-color: var(--primary-color);
}

.take-picture-button:hover {
    background-color: #45a049;
}

.take-picture-button.save:hover {
    background-color: #7986cb;
}

#video {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    background-color: var(--background-darker);
    min-height: 360px;
    position: relative;
}

#video::after {
    content: 'Camera will load here...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--secondary-color);
    font-size: 1.2rem;
    text-align: center;
    width: 100%;
}

#preview {
    max-width: 300px;
    margin: 20px auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* Log Section */
#everythingLog {
    background-color: var(--input-bg);
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    border: 1px solid var(--border-color);
}

.log-container {
    position: relative;
}

.copy-button {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--success-color);
    padding: 8px 16px;
    font-size: 0.9rem;
}

.copy-button:hover {
    background-color: #45a049;
}

.save-prompts {
    background-color: var(--primary-color);
    width: 100%;
    margin-top: 1rem;
}

/* Loading Animation */
.loading {
    text-align: center;
    color: var(--primary-color);
    padding: 1rem;
    font-weight: bold;
}

.hidden {
    display: none !important;
}

/* API Key Display */
.api-key-display {
    display: none;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.info-banner {
    background-color: var(--background-darker);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    line-height: 1.6;
}

.info-banner ul {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

.info-banner li {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.camera-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.camera-select {
    flex: 1;
    min-width: 200px;
}

.button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pictures-container {
    margin-top: 2rem;
    background: var(--background-darker);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.pictures-container h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.pictures-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.picture-item {
    position: relative;
    background: var(--background-dark);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease;
}

.picture-item:hover {
    transform: scale(1.02);
}

.picture-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.picture-info {
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-color);
    font-size: 0.9rem;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.remove-picture {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--error-color);
    border: none;
    padding: 0.5rem;
    color: white;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.picture-item:hover .remove-picture {
    opacity: 1;
}

.analyze-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.analyze-button {
    background-color: var(--success-color);
    padding: 12px 30px;
    font-size: 1.1rem;
}

.analyze-button:disabled {
    background-color: var(--secondary-color);
    cursor: not-allowed;
    opacity: 0.7;
}

.analyze-button:not(:disabled):hover {
    background-color: #45a049;
}

.prompt-info {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-left: 3px solid var(--primary-color);
    background: var(--background-dark);
}

.prompt-selector {
    margin-bottom: 1.5rem;
}

.prompt-selector select {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--background-dark);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    margin-top: 0.5rem;
}

.input-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.camera-section, .upload-section {
    background: var(--background-darker);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.upload-container {
    position: relative;
    min-height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.upload-container.dragover {
    border-color: var(--primary-color);
    background-color: rgba(var(--primary-color-rgb), 0.1);
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-input-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-color);
    pointer-events: none;
}

.upload-icon {
    font-size: 2rem;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .input-methods {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .camera-section, .upload-section {
        padding: 1rem;
    }

    .upload-container {
        min-height: 150px;
    }

    .section {
        margin-bottom: 1.5rem;
    }

    textarea {
        min-height: 100px;
    }

    .pictures-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .picture-item img {
        height: 120px;
    }

    .picture-info {
        font-size: 0.8rem;
    }

    .remove-picture {
        opacity: 1;
        font-size: 0.9rem;
    }

    .pictures-container {
        padding: 1rem;
        margin-top: 1rem;
    }
}
