/**
 * Nearby Sports Programs Finder - Styles
 * All styles are prefixed with .nsf- to prevent theme overrides
 */

/* Reset and base wrapper */
.nsf-wrapper {
    all: initial;
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.nsf-wrapper *,
.nsf-wrapper *::before,
.nsf-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Search Container */
.nsf-search-container {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nsf-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.3;
}

/* Search Form */
.nsf-search-form {
    display: block;
}

.nsf-form-group {
    margin-bottom: 0;
}

.nsf-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 16px;
}

.nsf-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.nsf-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
    color: #333;
    background: #fff;
}

.nsf-input:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.nsf-input::placeholder {
    color: #a0aec0;
}

.nsf-button {
    padding: 12px 32px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #fff !important;
    background: var(--nsf-button-color, #667eea) !important;
    background-color: var(--nsf-button-color, #667eea) !important;
    background-image: none !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: none !important;
    font-family: inherit !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    line-height: normal !important;
    display: inline-block !important;
}

.nsf-button:hover,
.nsf-button:focus,
.nsf-button:visited {
    color: #fff !important;
    background: var(--nsf-button-color, #667eea) !important;
    background-color: var(--nsf-button-color, #667eea) !important;
    background-image: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    text-decoration: none !important;
    outline: none !important;
    transform: none !important;
}

.nsf-button:active {
    opacity: 0.9 !important;
    background: var(--nsf-button-color, #667eea) !important;
    background-color: var(--nsf-button-color, #667eea) !important;
    color: #fff !important;
    box-shadow: none !important;
    transform: none !important;
}

.nsf-button:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Loading Spinner */
.nsf-loading {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.nsf-loading p {
    margin-top: 15px;
    color: #4a5568;
    font-size: 16px;
}

.nsf-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: nsf-spin 0.8s linear infinite;
}

@keyframes nsf-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error Message */
.nsf-error {
    display: none;
    background: #fed7d7;
    border: 1px solid #fc8181;
    border-radius: 6px;
    padding: 15px 20px;
    margin-top: 20px;
    color: #c53030;
    font-weight: 500;
}

/* Results Container */
.nsf-results-container {
    display: none;
}

.nsf-results-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.3;
}

.nsf-results-list {
    display: grid;
    gap: 20px;
}

/* Program Item */
.nsf-program-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.nsf-program-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.nsf-program-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 20px;
    gap: 15px;
}

.nsf-program-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    flex: 1;
}

.nsf-program-title a {
    color: #2d3748;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nsf-program-title a:hover {
    color: var(--nsf-button-color, #667eea);
}

.nsf-program-distance {
    display: inline-block;
    padding: 6px 12px;
    background: var(--nsf-button-color, #667eea);
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.nsf-program-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nsf-program-field {
    display: flex;
    align-items: start;
    gap: 10px;
    line-height: 1.6;
}

.nsf-program-icon {
    flex-shrink: 0;
    color: var(--nsf-button-color, #667eea);
    display: flex;
    align-items: center;
}

.nsf-program-label {
    font-weight: 600;
    color: #4a5568;
    flex-shrink: 0;
}

.nsf-program-value {
    color: #2d3748;
}

.nsf-program-value a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nsf-program-value a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.nsf-separator {
    display: inline-block;
    margin: 0 8px;
    color: #cbd5e0;
}

.nsf-program-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    text-align: right;
}

.nsf-view-details {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 10px 20px !important;
    background: var(--nsf-button-color, #667eea) !important;
    background-color: var(--nsf-button-color, #667eea) !important;
    background-image: none !important;
    color: #fff !important;
    text-decoration: none !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

.nsf-view-details:hover,
.nsf-view-details:focus,
.nsf-view-details:visited {
    background: var(--nsf-button-color, #667eea) !important;
    background-color: var(--nsf-button-color, #667eea) !important;
    background-image: none !important;
    color: #fff !important;
    text-decoration: none !important;
    transform: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
}

.nsf-view-details:active {
    opacity: 0.9 !important;
}

.nsf-view-details svg {
    flex-shrink: 0 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nsf-wrapper {
        padding: 15px;
    }

    .nsf-search-container {
        padding: 20px;
    }

    .nsf-title {
        font-size: 24px;
    }

    .nsf-input-wrapper {
        flex-direction: column;
    }

    .nsf-button {
        width: 100%;
    }

    .nsf-program-header {
        flex-direction: column;
        align-items: start;
    }

    .nsf-program-distance {
        align-self: start;
    }

    .nsf-program-field {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .nsf-title {
        font-size: 20px;
    }

    .nsf-results-title {
        font-size: 20px;
    }

    .nsf-program-title {
        font-size: 18px;
    }

    .nsf-program-item {
        padding: 18px;
    }
}

/* Print Styles */
@media print {
    .nsf-search-container {
        display: none;
    }

    .nsf-program-item {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}
