/**
 * Public styles for Tennis Activity Tracker
 */

/* Dashboard Cards */
.tat-dashboard .uk-card-primary,
.tat-dashboard .uk-card-secondary,
.tat-dashboard .uk-card-default,
.tat-payments-list .uk-card-default {
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tat-dashboard .uk-card-primary:hover,
.tat-dashboard .uk-card-secondary:hover,
.tat-dashboard .uk-card-default:hover,
.tat-payments-list .uk-card-default:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.tat-dashboard .uk-card-primary [uk-icon],
.tat-dashboard .uk-card-secondary [uk-icon],
.tat-dashboard .uk-card-default [uk-icon] {
    margin-bottom: 10px;
}

.tat-dashboard .uk-card-body h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

/* Icon Circle for Cards */
.tat-icon-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
}

/* Tables */
.tat-dashboard .uk-table {
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}

.tat-dashboard .uk-table th {
    background-color: #f8f8f8;
    font-weight: 600;
}

.tat-dashboard .uk-table-hover tbody tr:hover {
    background-color: #f5f5f5;
}

/* Buttons */
.tat-dashboard .uk-button-primary {
    color: white;
    transition: background-color 0.3s ease;
}

.tat-dashboard .uk-button-primary:hover {
    background-color: #0e6dcd;
}

.tat-dashboard .uk-button-default {
    background-color: #f8f8f8;
    color: #666;
    border: 1px solid #e5e5e5;
    transition: all 0.3s ease;
}

.tat-dashboard .uk-button-default:hover {
    background-color: #f2f2f2;
    border-color: #ccc;
}

/* Forms */
.tat-form .uk-form-label {
    font-weight: 600;
    margin-bottom: 5px;
}

.tat-form .uk-input,
.tat-form .uk-select,
.tat-form .uk-textarea {
    border-radius: 4px;
    border: 1px solid #e5e5e5;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.tat-form .uk-input:focus,
.tat-form .uk-select:focus,
.tat-form .uk-textarea:focus {
    /* Removing custom box-shadow to use UIkit's default focus styling */
    box-shadow: none;
}

/* Alerts */
.tat-dashboard .uk-alert {
    border-radius: 4px;
}

.tat-dashboard .uk-alert-success {
    background-color: #edfbf6;
    color: #32d296;
    border: 1px solid #d0f2e6;
}

.tat-dashboard .uk-alert-warning {
    background-color: #fff9f0;
    color: #faa05a;
    border: 1px solid #ffe7d3;
}

.tat-dashboard .uk-alert-danger {
    background-color: #fef4f6;
    color: #f0506e;
    border: 1px solid #fdd0d8;
}

/* Payment Cards */
.tat-payments-list .uk-card-small .uk-card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.tat-payments-list .uk-card-small .uk-text-large {
    font-size: 1.5rem;
}

.tat-payments-list .uk-card-header {
    border-bottom: 1px solid #f0f0f0;
}

.tat-payments-list .uk-card-footer {
    border-top: 1px solid #f0f0f0;
}

/* Payment Chart */
.tat-payment-chart .period-btn.active {
    font-weight: 600;
}

.tat-payment-chart .uk-button-group .uk-button + .uk-button {
    margin-left: -1px;
}

.tat-payment-chart .chart-container {
    min-height: 300px;
}

@media (max-width: 639px) {
    .tat-payment-chart .uk-button-group .uk-button {
        padding: 0 10px;
        font-size: 0.8rem;
    }
}

/* Coaches List Styles */
/* Custom styles to remove lines between coach rows and their details */
.tat-coaches-list tr.has-details {
    border-bottom: none !important;
}
.tat-coaches-list tr.coach-rates-details {
    border-top: none !important;
}
.tat-coaches-list tr.coach-rates-details td {
    padding-top: 0 !important;
}
/* Style the expanded details to match the row background */
.tat-coaches-list .expanded-rates-container {
    background: inherit;  /* Use same background as the row */
    box-shadow: none;
    padding: 10px;
    margin-top: 0;
    border: none;
}
/* Highlight effect for the entire row group when hovered */
.tat-coaches-list tr.has-details:hover + tr.coach-rates-details,
.tat-coaches-list tr.coach-rates-details:hover {
    background-color: #f8f8f8;
}
/* Round icon button styles */
.tat-coaches-list .icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 5px;
    text-decoration: none;
    transition: all 0.2s ease;
    color: #666;
    background-color: transparent;
    border: none;
}
.tat-coaches-list .icon-button-primary {
    /* Using UIkit's default styling instead of hardcoded color */
    color: var(--uk-primary-background, var(--uk-color-primary, currentColor));
}
.tat-coaches-list .icon-button-secondary {
    color: #666;
}
.tat-coaches-list .icon-button:hover {
    color: var(--uk-primary-background, var(--uk-color-primary, currentColor));
}

/* Payment Calculator Styles */
#calculation-results {
    transition: all 0.5s ease;
}

.calculation-notice {
    position: sticky;
    top: 50px;
    z-index: 100;
    margin-bottom: 20px;
}

.activity-row.selected {
    background-color: #f8f8ff;
}

.activity-row.unselected {
    opacity: 0.6;
}

.tat-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: var(--uk-primary-background, var(--uk-color-primary, currentColor));
    animation: tat-spin 1s ease-in-out infinite;
}

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

/* Styles for Cards (Coaches and Periods) */
.tat-payment-calculator #period-cards-container,
.tat-payment-calculator #coach-cards-container {
    display: grid !important;
    /* Default: 1 column for small screens */
    grid-template-columns: 1fr !important; 
    gap: 15px !important; /* Spacing between cards */
    margin-top: 10px !important; /* Space above the cards */
}

/* Apply 3 columns for screens wider than the 'small' breakpoint (e.g., 640px) */
@media (min-width: 640px) {
    .tat-payment-calculator #period-cards-container,
    .tat-payment-calculator #coach-cards-container {
        grid-template-columns: repeat(3, 1fr) !important; /* 3 columns */
    }
}

/* ADDITIONAL STRONGER FRONTEND GRID STYLES */
/* Force grid layout for coach and period cards container */
#coach-cards-container,
#period-cards-container {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 15px !important;
    margin-top: 10px !important;
    width: 100% !important;
}

@media (min-width: 640px) {
    #coach-cards-container,
    #period-cards-container {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Updated Card Styles for Payment Calculator */
.coach-card,
.period-card {
    border: 1px solid #e5e5e5 !important;
    cursor: pointer !important;
    transition: all 0.2s ease-in-out !important;
    text-align: center !important;
    font-size: 0.9rem !important;
    position: relative !important;
    display: block !important;
    margin-bottom: 5px !important;
    padding: 10px 15px !important;
    border-radius: 4px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}

/* Ensure the card-containers have proper styling */
#coach-cards-container .coach-card,
#period-cards-container .period-card {
    border: 1px solid #e5e5e5 !important;
    cursor: pointer !important;
}

/* Force cursor to pointer on hover */
.coach-card:hover,
.period-card:hover {
    cursor: pointer !important;
    box-shadow: 0 5px 15px rgba(0,0,0,.08) !important;
    transform: translateY(-2px) !important;
    z-index: 1 !important;
}

/* Current label - using multiple selectors and approaches */
.period-card.current:before,
.period-card.current::before,
.period-card.current:after,
.period-card.current::after,
.period-card[data-is-current="true"]:before,
.period-card[data-is-current="true"]::before {
    content: "Current" !important;
    position: absolute !important;
    top: -10px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background-color: #d23232 !important;
    color: white !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    font-size: 0.7rem !important;
    font-weight: bold !important;
    z-index: 100 !important;
    display: block !important;
}

/* Paid label - using multiple selectors and approaches */
.period-card.paid:before,
.period-card.paid::before,
.period-card.paid:after,
.period-card.paid::after,
.period-card[data-is-paid="true"]:before,
.period-card[data-is-paid="true"]::before {
    content: "Paid" !important;
    position: absolute !important;
    top: -10px !important;
    right: 10px !important;
    background-color: #32d296 !important;
    color: white !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    font-size: 0.7rem !important;
    font-weight: bold !important;
    z-index: 100 !important;
    display: block !important;
}

/* Combined Current + Paid label - using multiple approaches */
.period-card.current.paid:before,
.period-card.current.paid::before,
.period-card.current.paid:after,
.period-card.current.paid::after,
.period-card[data-is-current="true"][data-is-paid="true"]:before,
.period-card[data-is-current="true"][data-is-paid="true"]::before {
    content: "Current • Paid" !important;
    width: auto !important;
    white-space: nowrap !important;
    z-index: 100 !important;
    display: block !important;
}

/* Player Assignment Cards */
.player-card {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.player-card .uk-card {
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.player-card:hover .uk-card {
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-color: #e5e5e5;
}

.player-card.selected .uk-card {
    border-color: var(--uk-primary-background, var(--uk-color-primary, currentColor));
    background-color: rgba(30, 135, 240, 0.05);
}

.player-card .selection-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    display: none;
}

.player-card.selected .selection-indicator {
    display: block;
}

/* Selection styles - single border, no double border effect */
.coach-card.selected,
.period-card.selected {
    background-color: #f0f8ff !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important; /* Subtle shadow, no inset */
}

/* Make sure current/paid periods have STRONG green borders in frontend */
#coach-cards-container .period-card.current,
#period-cards-container .period-card.current,
.period-card.current,
.period-card[data-is-current="true"] {
    border: 1px solid #d23232 !important; /* Stronger green border */
}

#coach-cards-container .period-card.paid,
#period-cards-container .period-card.paid,
.period-card.paid,
.period-card[data-is-paid="true"] {
    border: 1px solid #32d296 !important; /* Stronger green border */
}

/* Even more specific selectors to override any other styles */
body .tat-payment-calculator .period-card.current,
body .tat-payment-calculator .period-card[data-is-current="true"] {
    border: 1px solid #32d296 !important;
}

body .tat-payment-calculator .period-card.paid,
body .tat-payment-calculator .period-card[data-is-paid="true"] {
    border: 1px solid #32d296 !important;
}

/* Still make selection take precedence */
.period-card.current.selected,
.period-card.paid.selected,
.period-card[data-is-current="true"].selected,
.period-card[data-is-paid="true"].selected {
    border: 2px solid #1e87f0 !important; /* Blue border precedence with thicker border */
}

/* Focus styles */
.coach-card:focus,
.period-card:focus {
    outline: 2px solid #1e87f0 !important;
    outline-offset: 2px !important;
    cursor: pointer !important;
}

/**
 * Tennis Activity Tracker - Capabilities Styling
 * Styles for the capabilities UI in the frontend
 */

/* Capabilities Section */
.tat-form-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tat-form-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e5e5;
    color: #23282d;
    font-size: 18px;
}

.tat-form-section .description {
    margin-bottom: 20px;
    color: #666;
    font-style: italic;
}

.tat-form-section .form-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.tat-form-section .form-table th,
.tat-form-section .form-table td {
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #eee;
}

.tat-form-section .form-table th {
    width: 200px;
    font-weight: 600;
}

.tat-form-section .form-table td label {
    display: inline-block;
    margin: 5px 0;
    cursor: pointer;
}

.tat-form-section .form-table input[type=checkbox] {
    margin-right: 8px;
}

/* Highlight admin-only section */
.tat-form-section.admin-only {
    background-color: #f0f6fc;
    border-left: 4px solid #2271b1;
}

/* Responsive design for smaller screens */
@media screen and (max-width: 782px) {
    .tat-form-section .form-table th,
    .tat-form-section .form-table td {
        padding: 10px 0;
        display: block;
        width: 100%;
    }
    
    .tat-form-section .form-table th {
        padding-bottom: 0;
        border-bottom: none;
    }
    
    .tat-form-section .form-table tr {
        border-bottom: 1px solid #eee;
    }
}

/* Disabled fields for non-admin users */
.tat-form-section input[disabled],
.tat-form-section select[disabled],
.tat-form-section textarea[disabled] {
    background-color: #f2f2f2;
    color: #888;
    cursor: not-allowed;
}

/* Opponent Search Styles */
.opponent-search-container {
    position: relative;
}

.opponent-search-results {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 2px;
    padding: 0 !important;
}

/* Override UIkit card padding for search results */
.opponent-search-results.uk-card-body {
    padding: 0 !important;
}

.opponent-search-results .uk-card-body {
    padding: 0 !important;
}

.opponent-result-item {
    padding: 4px 8px !important;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.opponent-result-item:hover,
.opponent-result-item.selected {
    background-color: #f8f8f8 !important;
}

/* More specific hover styles to override UIkit */
.opponent-search-results .opponent-result-item:hover {
    background-color: #f8f8f8 !important;
    color: inherit !important;
}

.opponent-result-item.add-new-opponent {
    border-top: 1px solid #787878;
    color: #1e87f0;
    font-weight: 500;
    font-size: 0.8rem;
    white-space: nowrap;
}

.opponent-result-item.add-new-opponent [uk-icon] {
    margin-right: 4px;
}

.opponent-result-item.add-new-opponent:hover {
    background-color: #f0f7ff !important;
}

/* Even more specific for add new opponent hover */
.opponent-search-results .opponent-result-item.add-new-opponent:hover {
    background-color: #f0f7ff !important;
    color: #1e87f0 !important;
}

/* Force hover effects with highest specificity */
.opponent-search-container .opponent-search-results .opponent-result-item:hover {
    background-color: #f8f8f8 !important;
    color: inherit !important;
    transition: background-color 0.2s ease !important;
}

.opponent-search-container .opponent-search-results .opponent-result-item.add-new-opponent:hover {
    background-color: #f0f7ff !important;
    color: #1e87f0 !important;
    transition: background-color 0.2s ease !important;
}

.opponent-search-input:focus + .opponent-search-results {
    border-color: #787878;
}

/* Loading state for search results */
.opponent-search-results .uk-text-center {
    color: #666;
    font-style: italic;
}

/* Error state for opponent search */
.opponent-search-input.uk-form-danger {
    border-color: #f0506e;
}

.opponent-search-input.uk-form-danger:focus {
    border-color: #f0506e;
    box-shadow: 0 0 0 3px rgba(240, 80, 110, 0.1);
} 