/**
 * USTA TOP - Frontend Styles
 * Mobile-first design for Telegram Web App
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

.header .subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* Container */
.container {
    max-width: 600px;
    margin: 20px auto;
    padding: 0 15px;
}

/* Page Sections */
.page {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Back Button */
.back-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #667eea;
    cursor: pointer;
    padding: 10px 0;
    margin-bottom: 20px;
    font-weight: 600;
}

.back-btn:active {
    opacity: 0.7;
}

/* Search Bar */
.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-bar input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Masters Grid */
.masters-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 600px) {
    .masters-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Master Card */
.master-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.master-card:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.master-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #333;
}

.master-card .job-type {
    display: inline-block;
    background-color: #667eea;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.master-card .info {
    font-size: 14px;
    color: #666;
    margin: 8px 0;
}

.master-card .price {
    font-size: 16px;
    font-weight: 700;
    color: #667eea;
    margin-top: 10px;
}

/* Master Detail Page */
.master-detail {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.master-detail h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

.master-detail .job-type {
    display: inline-block;
    background-color: #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
}

.master-detail .detail-item {
    margin: 15px 0;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.master-detail .detail-label {
    color: #999;
    font-size: 12px;
    margin-bottom: 5px;
}

.master-detail .detail-value {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.master-detail .actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Order Form Page */
.order-form-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.order-form-container h2 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #333;
}

.order-master-info {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.order-master-info .master-name {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.order-master-info .master-job {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* Order Form */
.order-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background-color: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn {
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:active {
    background-color: #5568d3;
    transform: scale(0.98);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.btn-secondary:active {
    background-color: #e0e0e0;
}

.btn-full {
    width: 100%;
}

/* Messages */
.message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.message.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
}

/* Notification */
.notification {
    position: fixed;
    bottom: -100px;
    left: 0;
    right: 0;
    margin: 0 15px 15px;
    padding: 14px 15px;
    background-color: #333;
    color: white;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    transition: bottom 0.3s;
    max-width: 570px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification.show {
    bottom: 20px;
}

/* Responsive Design */
@media (max-width: 480px) {
    .header h1 {
        font-size: 24px;
    }

    .container {
        margin: 15px auto;
        padding: 0 12px;
    }

    .master-detail h2 {
        font-size: 20px;
    }

    .btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}
