* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px;
}

header {
    text-align: center;
    margin-bottom: 24px;
}

header h1 {
    font-size: 1.8rem;
    color: #2d6a4f;
    margin-bottom: 4px;
}

header .subtitle {
    color: #6c757d;
    font-size: 0.95rem;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card h2 {
    font-size: 1.1rem;
    color: #2d6a4f;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Feed section */
.feed-row {
    display: flex;
    gap: 10px;
}

.feed-row input {
    flex: 1;
}

input[type="text"], input[type="number"] {
    padding: 10px 14px;
    border: 1.5px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    font-family: inherit;
}

input[type="text"]:focus, input[type="number"]:focus {
    outline: none;
    border-color: #2d6a4f;
}

input[type="number"] {
    width: 70px;
    text-align: center;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-weight: 500;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

#btnLoadFeed {
    background: #2d6a4f;
    color: white;
    white-space: nowrap;
}

#btnLoadFeed:hover {
    background: #1b4332;
}

.btn-small {
    padding: 5px 12px;
    font-size: 0.82rem;
    background: #e9ecef;
    color: #495057;
    border-radius: 6px;
}

.btn-small:hover {
    background: #dee2e6;
}

.btn-primary {
    background: #2d6a4f;
    color: white;
    padding: 12px 28px;
    font-size: 1rem;
}

.btn-primary:hover {
    background: #1b4332;
}

.btn-primary:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    transform: none;
}

/* Status */
.status {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.status.success {
    background: #d1fae5;
    color: #065f46;
}

.status.error {
    background: #fee2e2;
    color: #991b1b;
}

.status.loading {
    background: #e0f2fe;
    color: #075985;
}

.hidden {
    display: none;
}

/* Brands */
.brand-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.brand-item:hover {
    background: #e9ecef;
}

.brand-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2d6a4f;
    cursor: pointer;
}

.brand-item .brand-name {
    flex: 1;
    font-weight: 500;
}

.brand-item .brand-filter {
    color: #6c757d;
    font-size: 0.85rem;
}

.brand-item .brand-count {
    background: #2d6a4f;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.brand-item .brand-discount {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
}

.brand-item .btn-remove {
    padding: 4px 8px;
    background: transparent;
    color: #dc3545;
    font-size: 1.1rem;
    border-radius: 4px;
}

.brand-item .btn-remove:hover {
    background: #fee2e2;
}

/* Section move buttons */
.btn-move {
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    padding: 2px 6px;
    line-height: 1;
    color: #495057;
    transition: all 0.15s;
}

.btn-move:hover {
    background: #2d6a4f;
    color: white;
    border-color: #2d6a4f;
}

.section-row {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    background: #fafafa;
    transition: box-shadow 0.2s;
}

.section-row:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.brand-item .brand-langs {
    font-size: 0.75rem;
    color: #6c757d;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Columns */
.columns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.column-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9rem;
}

.column-item input[type="checkbox"] {
    accent-color: #2d6a4f;
    cursor: pointer;
}

/* Output */
.output-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.output-row label {
    font-weight: 500;
    white-space: nowrap;
}

.output-row input {
    flex: 1;
}

/* Actions */
.actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Log */
.log-area {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 14px;
    background: #1a1a2e;
    border-radius: 8px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #e0e0e0;
}

.log-area p {
    margin-bottom: 4px;
    line-height: 1.5;
}

.log-empty {
    color: #6c757d;
    font-style: italic;
}

.log-success {
    color: #6ee7b7;
}

.log-error {
    color: #fca5a5;
}

.log-info {
    color: #93c5fd;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Dialog overlay */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.dialog {
    background: white;
    border-radius: 12px;
    padding: 24px;
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.dialog h3 {
    margin-bottom: 16px;
    color: #2d6a4f;
}

.dialog .form-group {
    margin-bottom: 12px;
}

.dialog .form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 0.9rem;
}

.dialog .form-group input {
    width: 100%;
}

.dialog .dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Logo upload */
.logo-upload-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-preview {
    width: 200px;
    height: 80px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8f9fa;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-preview.has-logo {
    border-style: solid;
    border-color: #2d6a4f;
}

.btn-upload {
    cursor: pointer;
    background: #2d6a4f;
    color: white !important;
    padding: 8px 16px;
}

.btn-upload:hover {
    background: #1b4332;
}

.brand-logo-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding-left: 30px;
}

.brand-logo-preview {
    width: 100px;
    height: 40px;
    border: 1px dashed #dee2e6;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8f9fa;
}

.brand-logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brand-logo-preview.has-logo {
    border-style: solid;
    border-color: #2d6a4f;
}

.brand-subbrand-badge {
    background: #e0cffc;
    color: #5a3d8a;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    cursor: help;
}

/* ===== GOOGLE DRIVE BADGE ===== */
.gdrive-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    margin-left: 8px;
}
.gdrive-badge.active {
    background: #d4edda;
    color: #155724;
}
.gdrive-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* ===== HELP / NÁVOD SECTION ===== */
.help-section {
    border-top: 3px solid #2d6a4f;
}

.help-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.help-toggle:hover {
    color: #1b4332;
}

.help-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: #6c757d;
}

.help-arrow.open {
    transform: rotate(180deg);
}

.help-content {
    margin-top: 12px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.help-category {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e9ecef;
}

.help-category:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.help-category h3 {
    font-size: 1rem;
    color: #2d6a4f;
    margin-bottom: 8px;
}

.help-category ul, .help-category ol {
    margin: 0;
    padding-left: 20px;
}

.help-category li {
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 5px;
    line-height: 1.5;
}

.help-category p {
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.5;
}

.help-category code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: Consolas, 'Courier New', monospace;
    color: #d63384;
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 0.88rem;
}

.help-table th {
    background: #2d6a4f;
    color: white;
    padding: 8px 12px;
    text-align: left;
    font-weight: 500;
}

.help-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.help-table tr:hover td {
    background: #f8f9fa;
}

.help-tip {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    margin-top: 10px;
    font-size: 0.88rem;
}
