:root {
    --og-primary: #6366f1;
    --og-primary-hover: #4f46e5;
    --og-success: #10b981;
    --og-text: #1e293b;
    --og-text-light: #64748b;
    --og-bg: #f8fafc;
    --og-card-bg: #ffffff;
    --og-border: #e2e8f0;
    --og-radius: 12px;
}

.optigraph-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--og-text);
    background: var(--og-bg);
    padding: 24px;
    border-radius: var(--og-radius);
    max-width: 1000px;
    margin: 20px auto;
    border: 1px solid var(--og-border);
}

/* Header */
.optigraph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 20px;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-box {
    background: var(--og-primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-main h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.badge {
    font-size: 10px;
    background: #e0e7ff;
    color: var(--og-primary);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Controls */
.global-controls {
    display: flex;
    gap: 30px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.control-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--og-text-light);
}

.control-group input[type="range"] {
    width: 140px;
    cursor: pointer;
}

.opti-select {
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid var(--og-border);
    font-size: 13px;
    font-weight: 600;
    color: var(--og-text);
    outline: none;
}

.opti-select:focus {
    border-color: var(--og-primary);
}

.text-danger { color: #ef4444; }

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--og-border);
    background: var(--og-card-bg);
    border-radius: var(--og-radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--og-primary);
    background: #f5f7ff;
}

.upload-content i {
    width: 48px;
    height: 48px;
    color: var(--og-text-light);
    margin-bottom: 12px;
}

.upload-content h3 {
    margin: 0 0 8px;
}

.upload-content p {
    color: var(--og-text-light);
    margin: 0;
    font-size: 14px;
}

/* Gallery */
.gallery-toolbar {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

#stats-msg {
    font-size: 13px;
    font-weight: bold;
    color: var(--og-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.opti-card {
    background: var(--og-card-bg);
    border: 1px solid var(--og-border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.opti-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
}

.preview-container {
    aspect-ratio: 16/9;
    background: #f1f5f9;
    position: relative;
    overflow: hidden;
}

.preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.saving-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--og-success);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    cursor: pointer;
    transition: background 0.2s;
}

.remove-btn:hover {
    background: #ef4444;
    color: white;
}

.card-content {
    padding: 16px;
}

.card-title {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-item .label {
    display: block;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--og-text-light);
    margin-bottom: 2px;
}

.stat-item .value {
    font-size: 12px;
    font-weight: 700;
}

.stat-item .dim {
    display: block;
    font-size: 10px;
    color: var(--og-text-light);
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--og-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--og-primary-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-outline {
    width: 100%;
    justify-content: center;
    background: white;
    border: 1px solid var(--og-border);
    color: var(--og-text);
}

.btn-outline:hover {
    background: #f1f5f9;
}

/* Floating Summary */
.floating-summary {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid var(--og-border);
    padding: 12px 24px;
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 999;
}

.summary-item {
    display: flex;
    flex-direction: column;
}

.summary-item .label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--og-text-light);
}

.summary-item .value {
    font-size: 18px;
    font-weight: 900;
}

.text-success { color: var(--og-success); }

.divider {
    width: 1px;
    height: 30px;
    background: var(--og-border);
}

/* Lucide adjustments */
svg {
    width: 16px;
    height: 16px;
}
