/* ============================================================
   OPISOMAT — Panel Kliencki (rozszerzenie base.css + login.css)
   ============================================================ */

/* ── Reset & Body ─────────────────────────────────────────── */
body.client-body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', -apple-system, system-ui, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* ── Nagłówek panelu ──────────────────────────────────────── */
.panel-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(200, 200, 200, 0.35);
}

.panel-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.panel-header-left .logo {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 1.2px;
    color: #1c1c1e;
    text-shadow: 0 1px 3px rgba(255,255,255,0.4);
}

.panel-header-left .k2-badge {
    height: 32px;
    width: auto;
}

.panel-header-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.user-info {
    font-size: 13px;
    color: #444;
}

.user-info .email {
    font-weight: 600;
    color: #1c1c1e;
}

.credits-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #2e7d32;
}

.credits-badge.zero {
    background: linear-gradient(135deg, #fce4ec, #f8bbd0);
    color: #c62828;
}

.btn-logout {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #222;
}

/* ── Główny kontener ──────────────────────────────────────── */
.panel-content {
    width: 100%;
    max-width: 1100px;
    margin: 80px auto 60px;
    padding: 0 20px;
}

/* ── Sekcja ────────────────────────────────────────────────── */
.section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #666;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* ── Pakiety (3 karty) ────────────────────────────────────── */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .packages-grid {
        grid-template-columns: 1fr;
    }
}

.package-card {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(200, 200, 200, 0.55);
    border-radius: 12px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.package-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

.package-card.highlight {
    border-color: rgba(10, 132, 255, 0.4);
    box-shadow: 0 8px 32px rgba(10, 132, 255, 0.1);
}

.package-name {
    font-size: 18px;
    font-weight: 700;
    color: #1c1c1e;
    margin-bottom: 4px;
}

.package-credits {
    font-size: 32px;
    font-weight: 700;
    color: #0a84ff;
    margin: 12px 0 4px;
}

.package-credits span {
    font-size: 14px;
    font-weight: 400;
    color: #888;
}

.package-price {
    font-size: 13px;
    color: #888;
    margin-bottom: 18px;
}

.btn-buy {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, #2c2d33 0%, #1b1c1f 50%, #2c2d33 100%);
    background-size: 200% 200%;
    color: #f0f4ff;
    border: 1px solid rgba(120, 140, 255, 0.35);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.btn-buy:hover {
    background-position: 100% 100%;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(140, 160, 255, 0.35);
}

/* ── Formularz produktu ───────────────────────────────────── */
.form-card {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(200, 200, 200, 0.55);
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.form-row.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 768px) {
    .form-row, .form-row.three-col {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #666;
    margin-bottom: 6px;
}

.form-group .input-field {
    margin-top: 0;
}

/* Style selector */
.style-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #c7c7cc;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    background: #fff;
    outline: none;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.style-select:focus {
    border-color: #0a84ff;
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

.btn-generate {
    width: 100%;
    padding: 13px;
    margin-top: 8px;
    background: linear-gradient(135deg, #2c2d33 0%, #1b1c1f 25%, #2a2b30 50%, #1b1c1f 75%, #2c2d33 100%);
    background-size: 400% 400%;
    color: #f0f4ff;
    border: 1px solid rgba(120, 140, 255, 0.35);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    animation: buttonShine 4s ease-in-out infinite alternate;
    position: relative;
    overflow: hidden;
}

.btn-generate:hover {
    background-position: 100% 100%;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(140, 160, 255, 0.4);
}

.btn-generate:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    animation: none;
    transform: none;
    box-shadow: none;
}

.btn-generate.loading {
    animation: buttonPulse 1.5s ease-in-out infinite;
    pointer-events: none;
}

/* ── Wynik przetwarzania ──────────────────────────────────── */
.result-card {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(200, 200, 200, 0.55);
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
    display: none;
}

.result-card.visible {
    display: block;
}

/* Progress bar */
.progress-pipeline {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
}

.progress-step {
    flex: 1;
    text-align: center;
}

.progress-step .step-bar {
    height: 4px;
    border-radius: 2px;
    background: #e0e0e0;
    margin-bottom: 6px;
    transition: background 0.3s;
}

.progress-step .step-bar.completed {
    background: linear-gradient(135deg, #43a047, #66bb6a);
}

.progress-step .step-bar.running {
    background: linear-gradient(135deg, #1e88e5, #42a5f5);
    animation: progressPulse 1s ease-in-out infinite;
}

.progress-step .step-bar.error {
    background: linear-gradient(135deg, #e53935, #ef5350);
}

.progress-step .step-label {
    font-size: 9px;
    color: #888;
    letter-spacing: 0.3px;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.result-description {
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    padding: 16px;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.04);
    margin-bottom: 16px;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #888;
    margin-bottom: 16px;
}

.result-meta .badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 11px;
}

.result-meta .badge-quality {
    background: #e8f5e9;
    color: #2e7d32;
}

.result-meta .badge-style {
    background: #e3f2fd;
    color: #1565c0;
}

.result-actions {
    display: flex;
    gap: 10px;
}

.btn-email {
    padding: 10px 24px;
    background: #0a84ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-email:hover {
    background: #0070e0;
    transform: translateY(-1px);
}

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

.btn-copy {
    padding: 10px 24px;
    background: rgba(0, 0, 0, 0.06);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ── Historia ─────────────────────────────────────────────── */
.history-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(200, 200, 200, 0.55);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}

.history-table th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #666;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    background: rgba(255,255,255,0.3);
}

.history-table td {
    font-size: 13px;
    color: #333;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-table tr:hover td {
    background: rgba(10, 132, 255, 0.03);
}

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.processing {
    background: #e3f2fd;
    color: #1565c0;
}

.status-badge.error {
    background: #fce4ec;
    color: #c62828;
}

.status-badge.pending {
    background: #fff3e0;
    color: #e65100;
}

/* ── Glassmorphism card (register/login) ──────────────────── */
.auth-card {
    width: 360px;
    padding: 36px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(200, 200, 200, 0.55);
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}

.auth-card .form-group {
    text-align: left;
    margin-top: 14px;
}

.auth-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #1c1c1e;
}

.auth-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: #555;
}

.auth-link {
    display: block;
    margin-top: 16px;
    font-size: 13px;
    color: #0a84ff;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

/* ── Alerts / Messages ────────────────────────────────────── */
.alert {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 14px;
    display: none;
}

.alert.visible {
    display: block;
}

.alert.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.alert.error {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #f8bbd0;
}

.alert.info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 13px;
}

/* ── Processing overlay text ──────────────────────────────── */
.processing-status {
    text-align: center;
    padding: 16px;
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

/* ── Footer override for panel ────────────────────────────── */
.panel-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 24px;
    font-size: 11px;
    color: #999;
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(8px);
    z-index: 10;
}
