/* ===== Polden Studio Web App ===== */

/* Gilroy — фирменный шрифт Полдени */
@font-face {
    font-family: 'Gilroy';
    src: url('gilroy-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Gilroy';
    src: url('gilroy-medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Gilroy';
    src: url('gilroy-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Polden brand */
    --gold: #B8935A;
    --gold-light: #D4AF7A;
    --gold-dim: rgba(184, 147, 90, 0.15);
    --gold-glow: rgba(184, 147, 90, 0.3);

    /* Telegram theme vars (fallbacks) */
    --tg-theme-bg-color: #1a1a2e;
    --tg-theme-secondary-bg-color: #16213e;
    --tg-theme-text-color: #e8e8e8;
    --tg-theme-hint-color: #8899aa;
    --tg-theme-link-color: #64b5f6;
    --tg-theme-button-color: #B8935A;
    --tg-theme-button-text-color: #ffffff;

    /* Derived */
    --bg: var(--tg-theme-bg-color);
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --text: var(--tg-theme-text-color);
    --text-dim: var(--tg-theme-hint-color);
    --accent: var(--gold);
    --radius: 14px;
    --radius-sm: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px 100px;
}

/* ===== Header ===== */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 16px;
}

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

.logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gold-dim);
    border-radius: 12px;
    animation: logoFade 1s ease-out;
}

@keyframes logoFade {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 1px;
}

.header-user {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gold-dim);
    border: 2px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--gold);
    overflow: hidden;
}

.header-user img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* ===== Tabs ===== */

.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.05);
}

.tab {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.tab-icon {
    font-size: 16px;
    transition: transform 0.25s ease;
}

.tab.active {
    background: var(--gold-dim);
    color: var(--gold);
    font-weight: 600;
}

.tab.active .tab-icon {
    transform: scale(1.15);
}

.tab:active {
    transform: scale(0.96);
}

/* ===== Tab Content ===== */

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* ===== Stats ===== */

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 14px 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.5;
}

.stat-card:active {
    transform: scale(0.97);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-badge {
    margin-top: 6px;
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.stat-badge.online {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

/* ===== Section Title ===== */

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

/* ===== Action Cards ===== */

.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
}

.action-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.action-card:active {
    transform: scale(0.97);
    background: var(--bg-card-hover);
}

.action-icon {
    font-size: 28px;
    line-height: 1;
}

.action-text {
    flex: 1;
}

.action-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.action-desc {
    font-size: 12px;
    color: var(--text-dim);
}

.action-arrow {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 16px;
    color: var(--text-dim);
    opacity: 0.5;
}

/* Color accents per card */
.action-card:nth-child(1) { border-left: 3px solid #B8935A; }
.action-card:nth-child(2) { border-left: 3px solid #64b5f6; }
.action-card:nth-child(3) { border-left: 3px solid #ef4444; }
.action-card:nth-child(4) { border-left: 3px solid #a78bfa; }

/* ===== Links List ===== */

.links-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    overflow: hidden;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
}

.link-item:last-child {
    border-bottom: none;
}

.link-item:active {
    background: var(--bg-card-hover);
}

.link-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.link-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.link-badge {
    font-size: 11px;
    color: var(--text-dim);
    background: rgba(255,255,255,0.06);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 500;
}

/* ===== Services ===== */

.services-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-item {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s ease;
    text-decoration: none;
    color: var(--text);
}

.service-item:active {
    transform: scale(0.98);
}

.service-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.service-status.up {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

.service-status.unknown {
    background: #6b7280;
}

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

.service-info {
    flex: 1;
}

.service-name {
    font-size: 14px;
    font-weight: 600;
}

.service-url {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 1px;
}

.service-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

/* ===== Feedback Form ===== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

.category-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill {
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    background: var(--bg-card);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill.active {
    background: var(--gold-dim);
    border-color: var(--gold);
    color: var(--gold);
}

.pill:active {
    transform: scale(0.95);
}

.pill.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.form-textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s ease;
}

.form-textarea::placeholder {
    color: var(--text-dim);
    opacity: 0.6;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-dim);
}

.priority-selector {
    display: flex;
    gap: 8px;
}

.priority-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.priority-btn.active {
    border-color: rgba(255,255,255,0.15);
    color: var(--text);
    background: var(--bg-card-hover);
}

.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.priority-dot.low { background: #6b7280; }
.priority-dot.normal { background: #f59e0b; }
.priority-dot.high { background: #ef4444; }

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    border: none;
    border-radius: var(--radius);
    color: #1a1a2e;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
    margin-bottom: 12px;
}

.submit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.submit-btn:not(:disabled):active {
    transform: scale(0.98);
    opacity: 0.9;
}

.submit-icon {
    font-size: 18px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-dim);
    text-align: center;
    line-height: 1.4;
}

/* ===== Toast ===== */

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(16, 185, 129, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ===== Responsive ===== */

@media (max-width: 360px) {
    .stats-row { gap: 6px; }
    .stat-value { font-size: 20px; }
    .actions-grid { gap: 8px; }
    .action-card { padding: 14px; }
}
