/* Compare Page Styles - متناسق مع ألوان الهيدر */

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

body {
    font-family: 'Cairo', Arial, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    direction: rtl;
    text-align: right;
}

.mediator {
    height: 20px;
    background: transparent;
}

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

/* Search Section Styles */
.search-section {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 50%, #3d7ab8 100%);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 20px 40px rgba(30, 58, 95, 0.3);
    position: relative;
    overflow: hidden;
}

.search-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.1;
    pointer-events: none;
}

.search-title {
    color: white;
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.search-title i {
    color: #6dd5b5;
    margin-left: 10px;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    position: relative;
    z-index: 1;
}

.phone-search {
    position: relative;
}

.phone-search label {
    display: block;
    color: white;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.search-input-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 15px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.8);
}

.search-input:focus {
    outline: none;
    border-color: #6dd5b5;
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(109, 213, 181, 0.3);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 18px;
}

/* Search Results Styles */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(30, 58, 95, 0.3);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 5px;
    display: none;
    border: 1px solid rgba(30, 58, 95, 0.1);
}

.search-results.show {
    display: block;
    animation: slideDown 0.3s ease;
}

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

.search-result-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-result-item:hover {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    color: white;
    transform: translateX(-5px);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
    margin-left: 15px;
    border: 2px solid rgba(30, 58, 95, 0.1);
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    font-weight: 600;
    color: #1e3a5f;
    font-size: 14px;
    margin-bottom: 5px;
}

.search-result-item:hover .search-result-name {
    color: white;
}

.search-result-brand {
    font-size: 12px;
    color: #666;
}

.search-result-item:hover .search-result-brand {
    color: rgba(255,255,255,0.8);
}

/* Selected Phone Styles */
.selected-phone {
    display: none;
    align-items: center;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(109, 213, 181, 0.5);
    border-radius: 15px;
    padding: 15px;
    color: white;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.selected-phone img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    margin-left: 15px;
}

.selected-phone-info {
    flex: 1;
}

.selected-phone-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.selected-phone-brand {
    font-size: 14px;
    opacity: 0.8;
}

.remove-selection {
    position: absolute;
    top: -5px;
    left: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.remove-selection:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Compare Button Styles */
.compare-btn {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #6dd5b5 0%, #4ade80 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.compare-btn:disabled {
    background: rgba(255,255,255,0.3);
    cursor: not-allowed;
    transform: none;
}

.compare-btn:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(109, 213, 181, 0.4);
}

.compare-btn i {
    margin-left: 10px;
}

/* Loading Styles */
.loading {
    display: none;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(30, 58, 95, 0.1);
    margin-bottom: 40px;
}

.loading i {
    font-size: 3rem;
    color: #1e3a5f;
    margin-bottom: 20px;
}

.loading p {
    color: #666;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Comparison Result Styles */
.comparison-result {
    display: none;
}

.phones-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.phone-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 40px rgba(30, 58, 95, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.phone-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 60px rgba(30, 58, 95, 0.2);
    border-color: rgba(109, 213, 181, 0.3);
}

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

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

.phone-image {
    width: 80px;
    height: 80px;
    border-radius: 15px;
    object-fit: cover;
    border: 3px solid #f1f5f9;
}

.phone-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 5px;
}

.phone-brand {
    color: #64748b;
    font-weight: 500;
}

.phone-rating {
    display: flex;
    gap: 3px;
}

.star {
    font-size: 16px;
    color: #e2e8f0;
}

.star.filled {
    color: #fbbf24;
}

.phone-details p {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* Specs Section Styles */
.specs-section {
    margin-bottom: 25px;
}

.specs-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #1e3a5f;
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.specs-title i {
    color: #6dd5b5;
    font-size: 18px;
}

.specs-grid {
    display: grid;
    gap: 10px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.spec-label {
    color: #64748b;
    font-size: 14px;
}

.spec-value {
    font-weight: 600;
    color: #1e3a5f;
    font-size: 14px;
}

/* Price Section Styles */
.price-section {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    color: white;
    margin-top: 20px;
}

.price-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 10px;
}

.price-title i {
    color: #6dd5b5;
}

.price-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #6dd5b5;
    margin-bottom: 5px;
}

.price-country {
    font-size: 14px;
    opacity: 0.8;
}

/* Comparison Table Styles */
.comparison-table {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(30, 58, 95, 0.1);
}

.table-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    color: white;
    padding: 25px;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.table-header i {
    color: #6dd5b5;
}

.table-content {
    padding: 0;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.table-row:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.table-row:last-child {
    border-bottom: none;
}

.table-row > div {
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-left: 1px solid #e2e8f0;
    font-weight: 500;
}

.table-row > div:last-child {
    border-left: none;
}

.table-category {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 600 !important;
    color: #1e3a5f !important;
}

.winner {
    background: linear-gradient(135deg, #6dd5b5 0%, #4ade80 100%) !important;
    color: white !important;
    font-weight: 700 !important;
    position: relative;
}

.winner::before {
    content: '👑';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 14px;
}

/* Footer Styles */
footer {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
    border-radius: 20px 20px 0 0;
}

footer p {
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-form {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .phones-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .table-row {
        font-size: 14px;
    }
    
    .table-row > div {
        padding: 15px 10px;
    }
    
    .phone-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .search-title {
        font-size: 1.8rem;
    }
    
    .search-section {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .phone-card {
        padding: 20px;
    }
    
    .search-section {
        padding: 25px 15px;
    }
    
    .table-header {
        padding: 20px 15px;
        font-size: 1.1rem;
    }
    
    .table-row > div {
        padding: 12px 8px;
        font-size: 13px;
    }
}

/* Scrollbar Styles */
.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb {
    background: #6dd5b5;
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #4ade80;
}

/* Animation for smooth transitions */
.phone-card,
.comparison-table,
.search-section {
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}