/**
 * Cheap2Find Styles
 * Frontend styles for the search interface
 */

/* Layout Safeguards */
.cheap2find-search-container,
.cheap2find-search-container *,
.cheap2find-search-container *::before,
.cheap2find-search-container *::after {
    box-sizing: border-box;
}

.cheap2find-search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    /* Prevent horizontal overflow */
    width: 100%;
}

.cheap2find-header {
    text-align: center;
    padding: 30px 0 20px;
}

.cheap2find-logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.cheap2find-tagline {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto 30px;
}

.cheap2find-search-box {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 30px;
    width: 100%;
}

.search-input-container {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

#ctf-search-input {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s;
    background: #f8fafc;
    min-width: 0;
    /* Important for flex items on mobile */
}

#ctf-search-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

#ctf-search-button {
    padding: 14px 28px;
    background: #10b981;
    color: white !important;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

#ctf-search-button:hover {
    background: #059669;
    transform: translateY(-1px);
}

#ctf-search-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.search-suggestions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.suggestion-tag {
    background: #ecfdf5;
    color: #047857;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    border: 1px solid #d1fae5;
}

.suggestion-tag:hover {
    background: #10b981;
    color: white;
}

.location-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    margin-bottom: 1.5rem;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    justify-content: center;
    width: 100%;
}

.location-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.location-enabled {
    background: #28a745;
}

.location-disabled {
    background: #ffc107;
}

.ctf-loading {
    text-align: center;
    padding: 2rem;
    color: #10b981;
    font-weight: 500;
    width: 100%;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.ctf-results-container {
    width: 100%;
}

.ctf-results {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.5s ease-out;
    border: 1px solid #e1e5e9;
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ctf-summary {
    font-size: 1.1em;
    line-height: 1.8;
    color: #444;
    margin: 0;
    padding: 0;
}

.ctf-summary>*:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.ctf-summary h1,
.ctf-summary h2,
.ctf-summary h3 {
    color: #10b981;
    margin: 1.5rem 0 1rem 0;
    overflow-wrap: break-word;
}

.ctf-summary h1:first-child,
.ctf-summary h2:first-child,
.ctf-summary h3:first-child {
    margin-top: 0 !important;
}

.ctf-summary h1 {
    font-size: 1.8em;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e1e5e9;
}

.ctf-summary ul,
.ctf-summary ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.ctf-summary ul:first-child,
.ctf-summary ol:first-child {
    margin-top: 0 !important;
}

.ctf-summary li {
    margin-bottom: 0.5rem;
}

.ctf-summary p {
    margin: 1rem 0;
}

.ctf-summary p:first-child {
    margin-top: 0 !important;
}

.ctf-summary a {
    color: #10b981;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    word-break: break-all;
}

.ctf-summary a:hover {
    border-bottom-color: #10b981;
}

.ctf-phone-link {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white !important;
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none !important;
    font-weight: 500;
    display: inline-block;
    margin: 2px;
    transition: all 0.3s ease;
    border: none !important;
    white-space: nowrap;
}

.ctf-phone-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.ctf-error {
    color: #dc3545;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffe6e6, #ffd6d6);
    border-radius: 15px;
    margin: 1rem 0;
    font-weight: 500;
    text-align: center;
}

@media (max-width: 768px) {
    .cheap2find-search-container {
        padding: 12px;
    }

    .cheap2find-logo {
        font-size: 2rem;
    }

    .cheap2find-tagline {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .cheap2find-search-box {
        padding: 16px;
    }

    .search-input-container {
        flex-direction: column;
        gap: 8px;
    }

    #ctf-search-input {
        width: 100%;
        font-size: 14px;
        padding: 12px 16px;
    }

    #ctf-search-button {
        width: 100%;
        padding: 12px;
    }

    .ctf-results {
        padding: 1.25rem;
    }

    .suggestion-tag {
        font-size: 13px;
        padding: 6px 12px;
    }

    .ctf-summary h1 {
        font-size: 1.5em;
    }
}