/**
 * Stew Strings Nottingham - Frontend Styles
 *
 * @package Stew_Strings_Nottingham
 */

/* Customer portal container */
.ssn-customer-portal {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.ssn-customer-portal h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

/* Portal greeting */
.ssn-portal-greeting {
    margin-bottom: 10px;
}

.ssn-portal-greeting p {
    font-size: 18px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0;
}

/* Portal tabs */
.ssn-portal-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #ddd;
    margin-bottom: 25px;
}

.ssn-tab {
    display: inline-block;
    padding: 12px 20px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    font-size: 15px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.ssn-tab:hover {
    color: #0073aa;
    text-decoration: none;
}

.ssn-tab-active {
    color: #0073aa;
    border-bottom-color: #0073aa;
}

/* Portal content area */
.ssn-portal-content {
    min-height: 200px;
}

/* Job cards */
.ssn-job-list {
    display: grid;
    gap: 20px;
}

.ssn-job-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ssn-job-card h3 {
    margin: 0 0 10px;
    color: #1e1e1e;
    font-size: 17px;
}

.ssn-job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.ssn-job-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* String setup within job cards */
.ssn-job-strings {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 14px;
}

.ssn-string-row {
    margin-bottom: 4px;
    color: #444;
}

.ssn-string-row strong {
    color: #1e1e1e;
}

.ssn-job-notes {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #666;
}

/* Status badges */
.ssn-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.ssn-status-pending {
    background: #fff3cd;
    color: #856404;
}

.ssn-status-in_progress {
    background: #cce5ff;
    color: #004085;
}

.ssn-status-completed {
    background: #d4edda;
    color: #155724;
}

.ssn-status-collected {
    background: #e2e3e5;
    color: #383d41;
}

.ssn-status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* Racket info */
.ssn-racket-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ssn-racket-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
}

.ssn-racket-item h4 {
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ssn-racket-inactive {
    opacity: 0.7;
}

.ssn-racket-details {
    font-size: 14px;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

/* Details tab */
.ssn-detail-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.ssn-details-table {
    width: 100%;
    border-collapse: collapse;
}

.ssn-details-table th,
.ssn-details-table td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.ssn-details-table th {
    width: 120px;
    font-weight: 600;
    color: #1e1e1e;
}

.ssn-details-table td {
    color: #444;
}

.ssn-portal-contact-note {
    margin-top: 15px;
    font-size: 13px;
    color: #888;
    font-style: italic;
}

/* Empty state */
.ssn-empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

.ssn-empty-state p {
    margin: 0;
    font-size: 16px;
}

/* Filter bar */
.ssn-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.ssn-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ssn-filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #1e1e1e;
}

.ssn-filter-group select,
.ssn-filter-group input[type="date"] {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    min-width: 140px;
}

.ssn-filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.ssn-btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
}

.ssn-btn-primary {
    background: #0073aa;
    color: #fff;
}

.ssn-btn-primary:hover {
    background: #005a87;
    color: #fff;
}

.ssn-btn-secondary {
    background: #e2e3e5;
    color: #383d41;
}

.ssn-btn-secondary:hover {
    background: #d6d8db;
    color: #383d41;
    text-decoration: none;
}

.ssn-btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

/* Owner notes */
.ssn-job-owner-notes {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #666;
}

.ssn-job-owner-notes strong {
    display: block;
    margin-bottom: 4px;
    color: #1e1e1e;
}

.ssn-owner-notes-display {
    margin-bottom: 6px;
}

.ssn-no-notes {
    color: #999;
}

.ssn-owner-notes-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.ssn-owner-notes-actions {
    margin-top: 6px;
    display: flex;
    gap: 6px;
}

/* Back link */
.ssn-back-link {
    display: inline-block;
    margin-bottom: 15px;
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.ssn-back-link:hover {
    text-decoration: underline;
}

/* Racket detail card */
.ssn-racket-detail-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.ssn-racket-detail-card h3 {
    margin: 0 0 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

/* Section heading */
.ssn-section-heading {
    font-size: 17px;
    margin: 0 0 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    color: #1e1e1e;
}

/* Racket name link in list */
.ssn-racket-name-link {
    color: #0073aa;
    text-decoration: none;
}

.ssn-racket-name-link:hover {
    text-decoration: underline;
}

/* View details link */
.ssn-view-details-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 14px;
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.ssn-view-details-link:hover {
    text-decoration: underline;
}

/* =============================================
   Public Strings In Stock Listing
   ============================================= */

.ssn-stock-listing {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

.ssn-stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.ssn-stock-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}

.ssn-stock-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ssn-stock-card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f5f5f5 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ssn-stock-card-image img.ssn-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ssn-product-img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%) !important;
    border: none !important;
}

.ssn-stock-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ssn-stock-brand {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0073aa;
    margin-bottom: 4px;
}

.ssn-stock-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0 0 8px;
    line-height: 1.3;
}

.ssn-stock-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #666;
}

.ssn-stock-details span {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 3px;
}

.ssn-stock-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.ssn-stock-price {
    font-size: 18px;
    font-weight: 700;
    color: #1e1e1e;
}

.ssn-stock-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.ssn-stock-in {
    background: #d4edda;
    color: #155724;
}

.ssn-stock-out {
    background: #f8d7da;
    color: #721c24;
}

/* Expandable stock card toggle button */
.ssn-stock-card-toggle {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 6px 0;
    background: none;
    border: none;
    border-top: 1px solid #eee;
    font-size: 13px;
    font-weight: 500;
    color: #0073aa;
    cursor: pointer;
    text-align: center;
    transition: color 0.2s;
}

.ssn-stock-card-toggle:hover {
    color: #005a87;
}

.ssn-stock-card-toggle:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
    border-radius: 3px;
}

.ssn-stock-card-open .ssn-stock-card-toggle {
    color: #666;
}

/* Description panel */
.ssn-stock-card-description {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.35s ease;
    border-top: 0 solid #eee;
}

.ssn-stock-card-description[hidden] {
    display: block;
    max-height: 0;
    opacity: 0;
    padding: 0 16px;
    border-top-width: 0;
}

.ssn-stock-card-open .ssn-stock-card-description {
    max-height: 500px;
    opacity: 1;
    padding: 12px 16px 16px;
    border-top-width: 1px;
}

.ssn-stock-card-description-inner {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
}

.ssn-stock-card-description-inner p {
    margin: 0 0 8px;
}

.ssn-stock-card-description-inner p:last-child {
    margin-bottom: 0;
}

.ssn-stock-card-description-inner ul,
.ssn-stock-card-description-inner ol {
    margin: 0 0 8px 20px;
    padding: 0;
}

.ssn-stock-card-description-inner a {
    color: #0073aa;
    text-decoration: underline;
}

/* =============================================
   Job Request Form & Notices
   ============================================= */

/* Notices */
.ssn-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.ssn-notice-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ssn-notice-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Requests header */
.ssn-requests-header {
    margin-bottom: 20px;
}

/* Request form */
.ssn-request-form {
    max-width: 600px;
}

.ssn-form-fieldset {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 0 0 20px;
}

.ssn-form-fieldset legend {
    font-weight: 600;
    font-size: 15px;
    color: #1e1e1e;
    padding: 0 8px;
}

.ssn-form-group {
    margin-bottom: 16px;
}

.ssn-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e1e1e;
    margin-bottom: 4px;
}

.ssn-form-group select,
.ssn-form-group input[type="text"],
.ssn-form-group input[type="email"],
.ssn-form-group input[type="tel"],
.ssn-form-group input[type="password"],
.ssn-form-group input[type="number"],
.ssn-form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
}

.ssn-form-group textarea {
    resize: vertical;
}

.ssn-form-group input[type="number"] {
    max-width: 120px;
}

.ssn-form-help {
    font-size: 13px;
    color: #888;
    margin: 0 0 12px;
}

.ssn-required {
    color: #dc3545;
}

.ssn-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Login form */
.ssn-login-form {
    max-width: 420px;
    margin: 0 auto;
    padding: 20px;
}

.ssn-login-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ssn-login-links {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
}

.ssn-login-links a {
    color: #0073aa;
    text-decoration: none;
}

.ssn-login-links a:hover {
    text-decoration: underline;
}

/* Status badge for new requests */
.ssn-status-new {
    background: #d1ecf1;
    color: #0c5460;
}

/* Responsive */
@media (max-width: 600px) {
    .ssn-customer-portal {
        padding: 10px;
    }

    .ssn-portal-tabs {
        flex-wrap: wrap;
    }

    .ssn-tab {
        padding: 10px 14px;
        font-size: 14px;
    }

    .ssn-job-meta {
        flex-direction: column;
        gap: 8px;
    }

    .ssn-racket-details {
        flex-direction: column;
        gap: 5px;
    }

    .ssn-details-table th,
    .ssn-details-table td {
        display: block;
        padding: 5px 10px;
    }

    .ssn-details-table th {
        border-bottom: none;
        padding-bottom: 0;
    }

    .ssn-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .ssn-filter-group select,
    .ssn-filter-group input[type="date"] {
        min-width: auto;
        width: 100%;
    }

    .ssn-filter-actions {
        flex-direction: column;
    }

    .ssn-filter-actions .ssn-btn {
        text-align: center;
    }

    .ssn-stock-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   Registration Form
   ============================================= */

/* Widen the card slightly so all fields breathe */
.ssn-registration-form {
    max-width: 520px;
}

/* =============================================
   Performance Ratings (string cards)
   ============================================= */

.ssn-ratings {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ssn-rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.ssn-rating-label {
    flex: 0 0 70px;
    color: #555;
    font-weight: 500;
}

.ssn-rating-track {
    flex: 1;
    height: 6px;
    background: #e5e5e5;
    border-radius: 3px;
    overflow: hidden;
}

.ssn-rating-fill {
    height: 100%;
    background: #0073aa;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.ssn-rating-value {
    flex: 0 0 32px;
    text-align: right;
    color: #333;
    font-weight: 600;
    font-size: 11px;
}

/* Tension unit toggle chip */
.ssn-tension-display {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    vertical-align: middle;
}
.ssn-t-primary,
.ssn-t-alt {
    font-size: inherit;
}
.ssn-t-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2f7;
    color: #4a6fa5;
    border: 1px solid #c8d8ea;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 0.72em;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.7;
    white-space: nowrap;
    min-width: 26px;
    transition: background 0.15s, color 0.15s;
}
.ssn-t-chip:hover {
    background: #dce8f5;
    color: #2c5282;
}

