* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa, #e4e9f2);
    padding: 20px;
    color: #2c3e50;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
}

h1 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 2.2rem;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.search-section {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.search-box {
    padding: 20px;
    width: 100%;
    max-width: 500px;
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.search-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.phone-number {
    font-size: 24px;
    font-weight: bold;
    color: white;
    background: #3498db;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(52,152,219,0.3);
}

.phone-number-2 {
    background: #2ecc71;
}

.search-header h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    text-align: center;
}

.selected-phone {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e0e7ff;
}

.selected-phone-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.selected-phone img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 6px;
    background: white;
    padding: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.selected-phone-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2c3e50;
}

.clear-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s;
}

.clear-btn:hover {
    background: #fce4e2;
}

.select-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 14px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.3s, box-shadow 0.3s;
    width: 100%;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 8px rgba(52,152,219,0.3);
}

.select-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(52,152,219,0.4);
}

.select-btn-2 {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 4px 8px rgba(46,204,113,0.3);
}

.select-btn-2:hover {
    box-shadow: 0 6px 12px rgba(46,204,113,0.4);
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: modalAppear 0.4s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
}

.modal-header h3 {
    font-size: 1.6rem;
    color: #2c3e50;
    text-align: center;
}

.close-modal {
    color: #aaa;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #e74c3c;
}

.search-input-container {
    position: relative;
    margin-bottom: 20px;
}

input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
    transition: border-color 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.2);
}

.search-results {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e7ff;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 15px;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.result-item {
    padding: 12px 18px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background-color 0.3s;
}

.result-item:hover {
    background-color: #f5f9ff;
}

.result-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 6px;
    background: #f8f9fa;
    padding: 5px;
}

.result-info {
    flex: 1;
}

.result-brand {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1rem;
}

.result-model {
    color: #7f8c8d;
    font-size: 0.95em;
}

.result-year {
    color: #7f8c8d;
    font-size: 0.95em;
    min-width: 90px;
    text-align: right;
}

.loader {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
}

.loader i {
    animation: spin 1s linear infinite;
    font-size: 24px;
}

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

.no-results {
    padding: 20px;
    color: #7f8c8d;
    text-align: center;
    font-size: 1.1rem;
}

.modal-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

.compare-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 16px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: transform 0.3s, box-shadow 0.3s;
    max-width: 300px;
    margin: 30px auto;
    display: block;
    box-shadow: 0 5px 15px rgba(231,76,60,0.3);
}

.compare-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 18px rgba(231,76,60,0.4);
}

.compare-btn:disabled {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.results-section {
    display: none;
    margin-top: 30px;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.section-title {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 1.8rem;
    position: relative;
    padding-bottom: 15px;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 2px;
}

.results-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.phone-card {
    flex: 1;
    min-width: 300px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.phone-card:hover {
    transform: translateY(-5px);
}

.phone-card h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e7ff;
    font-size: 1.5rem;
}

.comparison-table {
    margin-top: 40px;
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

th, td {
    padding: 15px 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

th {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f8fafc;
}

tr:hover {
    background-color: #f1f5f9;
}

.highlight {
    background-color: #e8f4fd;
    font-weight: bold;
    position: relative;
}

.highlight:after {
    content: '✓';
    position: absolute;
    right: 10px;
    color: #27ae60;
    font-weight: bold;
}

.phone-image {
    text-align: center;
    margin-bottom: 25px;
}

.phone-image img {
    max-width: 220px;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 1px solid #e0e7ff;
}

/* Стили для результатов сравнения */
.comparison-result {
    margin-top: 40px;
    text-align: center;
    background: #f8fafc;
    padding: 30px;
    border-radius: 12px;
}

.score-container {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
    flex-wrap: wrap;
    gap: 20px;
}

.score-card {
    padding: 25px;
    width: 100%;
    max-width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.score-card:hover {
    transform: translateY(-5px);
}

.score-card h4 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: #2c3e50;
    text-align: center;
}

.total-score {
    font-size: 3.5rem;
    font-weight: bold;
    margin: 15px 0;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.winner .total-score {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.loser .total-score {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.score-label {
    color: #7f8c8d;
    font-size: 1.1rem;
    text-align: center;
}

.winner {
    border: 2px solid #27ae60;
    position: relative;
    overflow: hidden;
}

.winner:before {
    content: 'გამარჯვებული';
    position: absolute;
    top: 10px;
    right: -25px;
    background: #27ae60;
    color: white;
    padding: 5px 30px;
    font-size: 0.9rem;
    font-weight: bold;
    transform: rotate(45deg);
}

.loser {
    border: 2px solid #f1f5f9;
}

.category-scores {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-top: 30px;
    gap: 15px;
}

.category {
    width: 100%;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-bottom: 15px;
}

.category-title {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: center;
}

.category-bar {
    height: 12px;
    background: #e0e7ff;
    border-radius: 6px;
    margin: 10px 0;
    overflow: hidden;
}

.category-fill {
    height: 100%;
    border-radius: 6px;
}

.phone-score {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: #7f8c8d;
}

.winner-banner {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-top: 30px;
    font-size: 1.3rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 15px;
}

.draw-banner {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-top: 30px;
    font-size: 1.3rem;
    display: inline-flex;
    align-items: center;
    gap: 15px;
}

/* Группы спецификаций */
.spec-group {
    margin-bottom: 25px;
}

.group-title {
    font-size: 1.2rem;
    margin: 20px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e7ff;
    color: #3498db;
    font-weight: bold;
    text-align: center;
}

.spec-item {
    margin-bottom: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.spec-title {
    font-weight: bold;
    color: #2c3e50;
    display: block;
    margin-bottom: 5px;
}

.spec-value {
    display: block;
    color: #34495e;
    font-size: 1.05rem;
}

/* Стили для мобильных спецификаций */
.mobile-specs {
    display: none;
    margin-top: 40px;
}

.spec-group-mobile {
    margin-bottom: 25px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.group-title-mobile {
    font-size: 1.2rem;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e7ff;
    color: #3498db;
    font-weight: bold;
    text-align: center;
}

.spec-item-mobile {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
}

.spec-name-mobile {
    width: 100%;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.spec-value-container {
    display: flex;
    width: 100%;
}

.spec-phone {
    width: 50%;
    padding: 8px;
}

.spec-phone-title {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 5px;
    font-weight: 500;
    text-align: center;
}

.spec-value-mobile {
    color: #34495e;
    font-size: 1.05rem;
    font-weight: 500;
    text-align: center;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .search-section {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .search-box {
        max-width: 100%;
        padding: 15px;
    }
    
    .results-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        margin: 0 -15px;
        padding: 0 15px 15px;
    }
    
    .phone-card {
        min-width: 85vw;
        flex: 0 0 auto;
        margin-right: 15px;
    }
    
    .score-container {
        flex-direction: column;
        align-items: center;
    }
    
    .score-card {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .category {
        width: 100%;
    }
    
    .comparison-table {
        display: none;
    }
    
    .phone-specs, .comparison-table {
        display: none;
    }
    
    .mobile-specs {
        display: block;
    }
    
    .phone-image {
        display: none;
    }
    
    #results-section {
        display: flex;
        flex-direction: column;
    }
    
    .comparison-result {
        order: 1;
    }
    
    .results-container {
        order: 3;
    }
    
    .mobile-specs {
        order: 2;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
  }
