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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    line-height: 1.5;
    min-height: 100vh;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: var(--tg-theme-secondary-bg-color, #f8f9fa);
    padding: 20px 16px;
    border-bottom: 1px solid var(--tg-theme-hint-color, #e0e0e0);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.avatar-container {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.user-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--tg-theme-button-color, #007aff);
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--tg-theme-button-color, #007aff);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 2px solid var(--tg-theme-button-color, #007aff);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bot-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bot-name {
    font-size: 14px;
    color: var(--tg-theme-hint-color, #999999);
    font-weight: 500;
}

.rating-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.rating-label {
    font-size: 12px;
    color: var(--tg-theme-hint-color, #999999);
    font-weight: 500;
}

.rating-select {
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    border: 1px solid var(--tg-theme-hint-color, #e0e0e0);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
}

.rating-select:focus {
    border-color: var(--tg-theme-button-color, #007aff);
}

@media (max-width: 480px) {
    .user-profile {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .avatar-container {
        align-self: center;
    }
    
    .user-info {
        text-align: center;
        width: 100%;
    }
    
    .rating-container {
        width: 100%;
    }
}

main {
    flex: 1;
    padding: 16px;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--tg-theme-hint-color, #e0e0e0);
    border-top: 4px solid var(--tg-theme-button-color, #007aff);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px auto;
}

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

.error {
    text-align: center;
    padding: 60px 20px;
}

.error button {
    background: var(--tg-theme-button-color, #007aff);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 16px;
}



.meetings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.meeting-card {
    background: var(--tg-theme-bg-color, #ffffff);
    border: 1px solid var(--tg-theme-hint-color, #e0e0e0);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.meeting-card:active {
    transform: scale(0.98);
}

.meeting-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.meeting-avatar {
    flex-shrink: 0;
}

.meeting-info {
    flex: 1;
    min-width: 0;
}

.meeting-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meeting-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--tg-theme-hint-color, #999999);
}

.separator {
    color: var(--tg-theme-hint-color, #999999);
    font-weight: 400;
}

.partner-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--tg-theme-button-color, #007aff);
}

.partner-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--tg-theme-hint-color, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--tg-theme-text-color, #666);
}

.partner-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    line-height: 1.2;
}

.bot-name {
    font-size: 14px;
    color: var(--tg-theme-hint-color, #999999);
    font-weight: 500;
}

.meeting-date {
    font-size: 14px;
    color: var(--tg-theme-hint-color, #999999);
    font-weight: 500;
}

.meeting-action {
    display: flex;
    justify-content: center;
    padding-top: 8px;
    border-top: 1px solid var(--tg-theme-hint-color, #e0e0e0);
}

.organizer-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--tg-theme-button-color, #007aff);
    font-weight: 500;
}

.rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating-stars {
    color: #ffd700;
}

.rating-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 200px;
}

.rating-emoji {
    font-size: 16px;
}

.rating-select {
    background: var(--tg-theme-secondary-bg-color, #f8f9fa);
    color: var(--tg-theme-text-color, #000000);
    border: 1px solid var(--tg-theme-hint-color, #e0e0e0);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
    position: relative;
}

.rating-select option {
    background: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    padding: 8px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--tg-theme-text-color, #000000);
}

.empty-state p {
    color: var(--tg-theme-hint-color, #999999);
    max-width: 300px;
    margin: 0 auto;
}
