/* Main CSS file for WhoCalled.online */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary-color: #10b981;
    --text-dark: #1f2937;
    --text-medium: #4b5563;
    --text-light: #6b7280;
    --text-error: #dc2626;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Skip to main content for accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    z-index: 1000;
    text-decoration: none;
    border-radius: 0 0 var(--radius) 0;
    transition: top 0.3s;
}

.skip-to-content:focus {
    top: 0;
}

/* Header */
header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.logo:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
    border-radius: var(--radius-sm);
}

.logo-icon {
    width: 44px;
    height: 44px;
    background-color: var(--primary-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.logo-text span {
    color: var(--primary-color);
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a:focus {
    color: var(--primary-color);
    outline: none;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a:focus::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.mobile-menu-btn:hover,
.mobile-menu-btn:focus {
    background-color: var(--bg-light);
    outline: 2px solid var(--primary-color);
}

/* Breadcrumb styles - ДОБАВЛЕНО */
.breadcrumb {
    margin-bottom: 20px;
    color: var(--text-light);
    font-size: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.breadcrumb a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb span {
    color: var(--text-dark);
    font-weight: 500;
}

.breadcrumb > *:not(:last-child)::after {
    content: '›';
    margin-left: 8px;
    color: var(--text-light);
}

/* Hero Section */
.hero {
    padding: 100px 0 80px;
    background-color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero h1 span {
    color: var(--primary-color);
}

.hero p {
    font-size: 20px;
    color: var(--text-medium);
    margin-bottom: 40px;
}

/* Search Form */
.search-container {
    max-width: 700px;
    margin: 0 auto 60px;
}

.search-form {
    background-color: var(--white);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

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

.form-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 18px;
    color: var(--text-dark);
}

.phone-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.country-code {
    padding: 16px;
    background-color: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-weight: 500;
    min-width: 110px;
    text-align: center;
    transition: var(--transition);
}

.phone-input {
    flex: 1;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 16px;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.phone-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.error-message {
    color: var(--text-error);
    font-size: 14px;
    margin-top: 8px;
    display: none; /* Изначально скрыт */
    align-items: center;
    gap: 6px;
    padding: 10px;
    background-color: rgba(220, 38, 38, 0.1);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.error-message.show {
    display: flex; /* Показываем только с классом show */
}

.error-message i {
    font-size: 16px;
    flex-shrink: 0;
}

.error-text {
    flex: 1;
}

.search-btn {
    width: 100%;
    padding: 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Inter', sans-serif;
    position: relative;
    min-height: 60px;
}

.search-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.search-btn:focus {
    outline: 2px solid var(--primary-dark);
    outline-offset: 2px;
}

.search-btn:disabled {
    background-color: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-text {
    transition: opacity 0.3s;
}

.search-btn.loading .btn-text {
    opacity: 0.7;
}

.spinner {
    display: none;
    position: absolute;
    right: 20px;
}

.search-btn.loading .spinner {
    display: block;
}

.spinner i {
    animation: spin 1s linear infinite;
}

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

.example-text {
    text-align: center;
    color: var(--text-light);
    font-size: 15px;
    margin-top: 16px;
}

.example-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    margin: 0 8px;
    cursor: pointer;
    transition: var(--transition);
}

.example-text a:hover,
.example-text a:focus {
    text-decoration: underline;
    outline: none;
}

.example-text small {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-light);
    font-style: italic;
}

/* Stats */
.stats {
    margin-top: 60px;
}

.stats-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    flex: 0 1 auto;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.stat-label {
    color: var(--text-medium);
    font-size: 15px;
    max-width: 150px;
    margin: 0 auto;
}

/* Recent Comments Section */
.recent-comments {
    padding: 60px 0;
    background-color: var(--white);
}

.comments-header {
    text-align: center;
    margin-bottom: 50px;
}

.comments-header h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.comments-header p {
    color: var(--text-medium);
    max-width: 700px;
    margin: 0 auto;
    font-size: 18px;
    line-height: 1.6;
}

.comments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.comment-card {
    background-color: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.comment-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    background-color: #f0f4f8;
}

.comment-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.comment-text {
    color: var(--text-dark);
    line-height: 1.6;
    flex-grow: 1;
}

/* Features Section */
.features {
    padding: 100px 0;
    background-color: var(--bg-light);
}

.section-title {
    text-align: center;
    font-size: 36px;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.section-subtitle {
    text-align: center;
    color: var(--text-medium);
    max-width: 700px;
    margin: 0 auto 60px;
    font-size: 18px;
    line-height: 1.6;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    height: 100%;
}

.feature-card:hover,
.feature-card:focus-within {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    background-color: rgba(37, 99, 235, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--primary-color);
    font-size: 24px;
}

.feature-card h3 {
    font-size: 22px;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.feature-card p {
    color: var(--text-medium);
    line-height: 1.6;
}

/* How It Works */
.how-it-works {
    padding: 100px 0;
    background-color: var(--white);
}

.steps {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.step {
    flex: 1;
    min-width: 250px;
    text-align: center;
    padding: 20px;
}

.step-number {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 24px;
    box-shadow: var(--shadow);
}

.step h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.step p {
    color: var(--text-medium);
    line-height: 1.6;
}

/* Testimonials */
.testimonials {
    padding: 100px 0;
    background-color: var(--bg-light);
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.testimonial-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 24px;
    color: var(--text-dark);
    line-height: 1.6;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 16px;
}

.author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
}

.author-info {
    flex: 1;
}

.author-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.author-location {
    color: var(--text-light);
    font-size: 14px;
}

/* SEO Content */
.seo-content {
    padding: 80px 0;
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
}

.seo-content h2 {
    font-size: 28px;
    margin-bottom: 24px;
    color: var(--text-dark);
}

.seo-content p {
    margin-bottom: 20px;
    color: var(--text-medium);
    line-height: 1.7;
}

/* Footer */
footer {
    background-color: var(--text-dark);
    color: white;
    padding: 80px 0 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    font-size: 20px;
    margin-bottom: 24px;
    color: white;
}

.footer-column p {
    color: #d1d5db;
    margin-bottom: 24px;
    line-height: 1.6;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 12px;
}

.footer-column ul li a {
    color: #d1d5db;
    text-decoration: none;
    transition: var(--transition);
    padding: 4px 0;
    display: inline-block;
}

.footer-column ul li a:hover,
.footer-column ul li a:focus {
    color: white;
    transform: translateX(4px);
    outline: none;
}

.social-links {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover,
.social-links a:focus {
    background-color: var(--primary-color);
    transform: translateY(-3px);
    outline: none;
}

.copyright {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid #374151;
    color: #9ca3af;
    font-size: 14px;
    line-height: 1.6;
}

/* Accessibility - Focus Styles */
:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 42px;
    }
    
    .steps {
        justify-content: center;
    }
    
    .step {
        flex: 0 1 300px;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 80px 0 60px;
    }
    
    .hero h1 {
        font-size: 36px;
    }
    
    .hero p {
        font-size: 18px;
    }
    
    .search-form {
        padding: 30px 20px;
    }
    
    /* Уменьшаем ширину .country-code на мобильных */
    .country-code {
        min-width: 80px; /* Уменьшили с 110px до 80px */
        padding: 14px 12px; /* Немного уменьшили padding */
        font-size: 14px; /* Уменьшили размер шрифта */
    }
    
    /* Убираем flex-direction: column для phone-input-wrapper */
    /* .phone-input-wrapper остается в строке на мобильных */
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--white);
        flex-direction: column;
        gap: 0;
        box-shadow: var(--shadow-lg);
        padding: 20px;
        border-top: 1px solid var(--border-color);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links a {
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .section-title {
        font-size: 32px;
    }
    
    .stats-grid {
        gap: 30px;
    }
    
    .stat-item {
        flex: 0 1 calc(50% - 15px);
    }
    
    .comments-grid {
        grid-template-columns: 1fr;
    }
    
    .phone-info-grid {
        grid-template-columns: 1fr;
    }
    
    .location-content {
        grid-template-columns: 1fr;
    }
    
    .search-again-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 30px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .feature-card,
    .testimonial-card,
    .comment-card {
        padding: 30px 20px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .phone-header h1 {
        font-size: 28px;
    }
    
    .phone-variations {
        grid-template-columns: 1fr;
    }
    
    .reviews-summary {
        flex-direction: column;
        gap: 20px;
    }
}

/* Print Styles */
@media print {
    .search-form,
    .mobile-menu-btn,
    .social-links,
    .example-text,
    .report-form,
    .search-again-section {
        display: none;
    }
    
    .hero {
        padding: 40px 0;
    }
    
    a {
        text-decoration: none;
        color: inherit;
    }
    
    .phone-details {
        padding: 30px 0;
    }
}

/* Visually hidden class for screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Input validation styles */
.input-error {
    color: var(--text-error);
    font-size: 14px;
    margin-top: 5px;
    padding-left: 5px;
    animation: fadeIn 0.3s ease;
}

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

/* Loading animation for buttons */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

/* Selection styles */
::selection {
    background-color: var(--primary-light);
    color: var(--text-dark);
}

::-moz-selection {
    background-color: var(--primary-light);
    color: var(--text-dark);
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}