/* Component Styles */

/* Button Components */
.btn {
    /* Keep current app-wide button look (previously coming from auth.css) */
    display: inline-block;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

/* Export Button - Unique Style */
.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-export:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
}

.btn-export:active {
    background: #dee2e6;
    transform: translateY(1px);
}

.export-arrow {
    font-size: var(--font-size-xs);
    margin-left: 0.25rem;
    transition: transform 0.2s ease;
}

.export-button-container:hover .export-arrow,
.export-button-container.active .export-arrow {
    transform: rotate(180deg);
}

.export-dropdown-menu {
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.export-dropdown-menu a {
    transition: background-color 0.15s ease;
}

.export-dropdown-menu a:hover {
    background-color: #f8f9fa;
}

/* Custom Dropdown Style - Replace native select elements */
.custom-dropdown {
    position: relative;
    display: inline-block;
}

.custom-dropdown-button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 150px;
    text-align: left;
}

.custom-dropdown-button:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
}

.custom-dropdown-button:active {
    background: #dee2e6;
    transform: translateY(1px);
}

.custom-dropdown-button .dropdown-arrow {
    font-size: var(--font-size-xs);
    margin-left: auto;
    transition: transform 0.2s ease;
}

.custom-dropdown.active .custom-dropdown-button .dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 0.25rem;
    max-height: 300px;
    overflow-y: auto;
}

/* When using fixed positioning (for table cells), ensure high z-index */
.custom-dropdown-menu[style*="position: fixed"] {
    z-index: 10000 !important;
}

.custom-dropdown.active .custom-dropdown-menu {
    display: block;
}

.custom-dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.custom-dropdown-item:last-child {
    border-bottom: none;
}

.custom-dropdown-item:hover {
    background-color: #f8f9fa;
}

.custom-dropdown-item.selected {
    background-color: #e7f3ff;
    color: #0066cc;
    font-weight: var(--font-weight-medium);
}

/* Hide native select elements when custom dropdown is used */
select.custom-dropdown-hidden {
    display: none;
}

/* Team Scores Section */
.team-scores-section {
    margin-top: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.team-scores-section h4 {
    margin-bottom: 1rem;
    color: #495057;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
}

/* Form Components */
.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.form-group label input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Search and Filter Components */
.search-box {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.search-box input {
    flex: 1;
    max-width: 300px;
}

/* Status and Message Components */
.status-message {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    font-weight: var(--font-weight-medium);
}

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

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

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Loading Components */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Card Components */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.card-title {
    margin: 0;
    color: #495057;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

/* Badge Components */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-primary {
    color: #fff;
    background-color: #667eea;
}

.badge-secondary {
    color: #fff;
    background-color: #6c757d;
}

.badge-success {
    color: #fff;
    background-color: #28a745;
}

.badge-danger {
    color: #fff;
    background-color: #dc3545;
}

.badge-warning {
    color: #212529;
    background-color: #ffc107;
}

.badge-info {
    color: #fff;
    background-color: #17a2b8;
}

/* Alert Components */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Button Group Components */
.button-group {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    align-items: center;
}

.button-group .btn {
    margin: 0;
}

/* Preview Modal Components */
.category-section {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.category-section h4 {
    margin-top: 0;
    color: #333;
}

.changes-list {
    margin-top: 15px;
}

.promotions-preview,
.divisions-preview {
    padding: 10px 0;
}

.promotions-preview h4,
.divisions-preview h4 {
    color: #495057;
    margin-bottom: 10px;
}

.promotions-preview p,
.divisions-preview p {
    color: #6c757d;
    margin-bottom: 15px;
}

.divisions-preview .category-section {
    margin-bottom: 1rem;
}

.divisions-preview .category-section:last-child {
    margin-bottom: 0;
}

.divisions-preview .category-section h4 {
    margin: 0 0 0.5rem;
}

.divisions-preview .category-section p {
    margin: 0 0 0.75rem;
}

.divisions-preview .table-container,
.divisions-preview .data-table {
    margin-top: 0;
}

.team-league-division {
    margin-top: 0.75rem;
}

.team-league-division:first-child {
    margin-top: 0;
}

.team-league-division h3 {
    margin-bottom: 0.25rem;
}

.team-league-division .table {
    margin-top: 0;
}
