/* style.css */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-card: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent: #4fc3f7;
    --accent-hover: #29b6f6;
    --border: #404040;
    --success: #66bb6a;
    --warning: #ffa726;
    --error: #f44336;
    --match: #ff9800;
    --formula: #ba68c8;
}

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

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.4;
    padding: 16px;
    padding-bottom: 80px;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--accent);
}

.header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.card.collapsed {
    padding: 12px 16px;
}

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

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.collapse-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.card-content {
    margin-top: 12px;
}

.card.collapsed .card-content {
    display: none;
}

.input-group {
    margin-bottom: 16px;
}

.input-label {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-field {
    width: 100%;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
}

.input-row {
    display: flex;
    gap: 12px;
}

.input-row .input-group {
    flex: 1;
}

.select-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b0b0b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.btn {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn:disabled {
    background: var(--border);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 16px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

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

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.user-id {
    font-size: 12px;
    color: var(--text-secondary);
}

.results {
    display: none;
}

.result-item {
    background: var(--bg-card);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.result-item.important {
    border-left: 4px solid var(--accent);
    background: linear-gradient(135deg, var(--bg-card), #2a3a4d);
}

.result-item.match {
    border-left: 4px solid var(--match);
    background: linear-gradient(135deg, var(--bg-card), #3a2a2d);
}

.result-item.formula {
    border-left: 4px solid var(--formula);
    background: linear-gradient(135deg, var(--bg-card), #3a2a3d);
}

.result-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.result-value {
    font-size: 16px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.planet-grid, .cycle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.planet-item, .cycle-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 6px;
    text-align: center;
}

.planet-name, .cycle-name {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.planet-degree, .cycle-value {
    font-size: 13px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.search-container {
    margin-bottom: 12px;
}

.search-input {
    width: 100%;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.search-info {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.time-steps-container {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
}

.time-step {
    background: rgba(255, 255, 255, 0.03);
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    border-left: 3px solid var(--border);
}

.time-step:nth-child(odd) {
    background: rgba(255, 255, 255, 0.05);
}

.time-step.highlighted {
    border-left-color: var(--accent);
    background: rgba(79, 195, 247, 0.1);
}

.step-time {
    font-weight: 600;
    margin-bottom: 2px;
}

.step-ascendant {
    color: var(--text-secondary);
}

.step-zodiac {
    font-size: 12px;
    color: var(--accent);
    margin-top: 2px;
}

.history-list {
    max-height: 500px;
    overflow-y: auto;
}

.history-item {
    background: var(--bg-card);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 4px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s;
}

.history-item:hover {
    border-left-color: var(--accent);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.history-price {
    font-weight: 600;
    font-size: 16px;
}

.history-details {
    font-size: 12px;
    color: var(--text-secondary);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.history-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.history-btn {
    padding: 4px 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 11px;
    cursor: pointer;
}

.history-btn.delete {
    color: var(--error);
    border-color: var(--error);
}

/* Стеклянное нижнее меню */
.bottom-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 30, 30, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    padding: 8px;
    z-index: 1000;
}

.menu-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 10px;
    gap: 4px;
}

.menu-item.active {
    color: var(--accent);
}

.menu-icon {
    font-size: 18px;
    margin-bottom: 2px;
}

.menu-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--accent);
    max-width: 300px;
    width: 90%;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.loading-details {
    font-size: 12px;
    color: var(--text-secondary);
}

.error-message {
    background: var(--error);
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: none;
}

.app-section {
    display: none;
}

.app-section.active {
    display: block;
}

.crypto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.crypto-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border);
}

.crypto-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.crypto-image {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
}

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

.crypto-symbol {
    font-size: 12px;
    color: var(--text-secondary);
}

.crypto-price {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.crypto-change {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.crypto-change.positive {
    background: rgba(102, 187, 106, 0.2);
    color: var(--success);
}

.crypto-change.negative {
    background: rgba(244, 67, 54, 0.2);
    color: var(--error);
}

.crypto-market-cap {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Окно оплаты */
.payment-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.payment-card {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.payment-title {
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--accent);
}

.payment-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.payment-btns {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.payment-btn {
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-full {
    background: #ff9800;
    color: white;
}

.btn-cancel {
    background: var(--bg-card);
    color: var(--text-primary);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .input-row {
        flex-direction: column;
        gap: 0;
    }
    .planet-grid, .cycle-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .time-steps-container {
        max-height: 300px;
    }
    .history-details {
        grid-template-columns: 1fr;
    }
    body {
        padding-bottom: 70px;
    }
    .menu-item {
        font-size: 9px;
        padding: 6px;
    }
}