/**
 * FirstXI Fantasy API Integration Styles
 * Styles for dynamic content loaded from API
 */

/* CSS Variables */
:root {
    --navy: #001233;
    --gold: #3c01dd;
    --electric-blue: #004AAD;
    --primary-blue: #0047a7;  /* New primary blue for enhanced UI */
    --white: #FFFFFF;
    --light-gray: #F5F5F5;
    --text-dark: #1A1A1A;
    --text-light: #666666;
}

/* Override Bootstrap button styles with FirstXI brand colors */
.btn-primary {
    background-color: var(--primary-blue) !important;
    border-color: var(--primary-blue) !important;
    color: var(--white) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary.focus {
    background-color: var(--navy) !important;
    border-color: var(--navy) !important;
    color: var(--white) !important;
}

.btn-primary:active,
.btn-primary.active {
    background-color: var(--navy) !important;
    border-color: var(--navy) !important;
    color: var(--white) !important;
}

.btn-primary:active:hover,
.btn-primary.active:hover {
    background-color: var(--navy) !important;
    border-color: var(--navy) !important;
    color: var(--white) !important;
}

/* Override .booking class styles with FirstXI brand colors - EXCLUDE main slider buttons */
.booking:not(.slider-booking) {
    background-color: var(--primary-blue) !important;
    color: var(--white) !important;
    border: none !important;
    padding: 15px 24px 13px 24px !important;
    border-radius: 9px !important;
    font-size: 16px !important;
    text-transform: uppercase !important;
    font-family: Montserrat, sans-serif !important;
    margin-top: 30px !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: all 0.3s ease !important;
}

.booking:not(.slider-booking):hover {
    background-color: var(--navy) !important;
    color: var(--white) !important;
    transform: translateY(-2px) !important;
}

/* Remove all color styling from main slider buttons - let them use default styling */
.booking.slider-booking {
    background-color: transparent !important;
    color: inherit !important;
    border: none !important;
    padding: 15px 24px 13px 24px !important;
    border-radius: 9px !important;
    font-size: 16px !important;
    text-transform: uppercase !important;
    font-family: Montserrat, sans-serif !important;
    margin-top: 30px !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: all 0.3s ease !important;
}

.booking.slider-booking:hover {
    background-color: transparent !important;
    color: inherit !important;
    transform: translateY(-2px) !important;
}

/* Loading States */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 16px;
}

.loading-spinner i {
    margin-right: 10px;
    font-size: 18px;
}

/* Error and Success Messages */
.error-message {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    color: #c33;
    margin: 10px 0;
}

.success-message {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #efe;
    border: 1px solid #cfc;
    border-radius: 8px;
    color: #3c3;
    margin: 10px 0;
}

.error-message i,
.success-message i {
    margin-right: 10px;
    font-size: 18px;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.badge-warning {
    background: #1543ad;
    color: #000;
}

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

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

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

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

/* Leaderboard Styles */
.leaderboard-container {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-gray);
}

.leaderboard-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
}

.leaderboard-subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin: 5px 0 0 0;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.leaderboard-entry:hover {
    background-color: #f8f9fa;
}

.leaderboard-entry:last-child {
    border-bottom: none;
}

.leaderboard-rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    margin-right: 15px;
}

.leaderboard-rank.top-3 {
    background: var(--gold);
    color: var(--navy);
}

.leaderboard-rank.top-10 {
    background: var(--primary-blue);
    color: var(--white);
}

.leaderboard-rank.other {
    background: var(--light-gray);
    color: var(--text-dark);
}

.leaderboard-player {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.leaderboard-name {
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 2px;
}

.leaderboard-username {
    font-size: 12px;
    color: var(--text-light);
}

.leaderboard-points {
    font-weight: 700;
    font-size: 18px;
    color: var(--primary-blue);
}

/* Tournament Cards */
.tournament-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.tournament-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e0e0e0;
}

.tournament-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

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

.tournament-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 5px 0;
}

.tournament-status {
    margin-left: 10px;
}

.tournament-competition {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
}

.tournament-details {
    margin: 15px 0;
}

.tournament-detail {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    font-size: 14px;
}

.tournament-detail-label {
    color: var(--text-light);
    font-weight: 500;
}

.tournament-detail-value {
    color: var(--navy);
    font-weight: 600;
}

.tournament-prize {
    color: var(--gold);
    font-weight: 700;
}

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

.tournament-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

.tournament-btn-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.tournament-btn-primary:hover {
    background: var(--navy);
    transform: translateY(-2px);
}

.tournament-btn-secondary {
    background: transparent;
    color: var(--electric-blue);
    border: 2px solid var(--electric-blue);
}

.tournament-btn-secondary:hover {
    background: var(--electric-blue);
    color: var(--white);
}

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

/* Gameweek Info */
.gameweek-info {
    background: linear-gradient(135deg, var(--navy) 0%, var(--primary-blue) 50%, var(--electric-blue) 100%);
    color: var(--white);
    padding: 30px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: center;
}

.gameweek-number {
    font-size: 48px;
    font-weight: 800;
    margin: 0 0 10px 0;
    color: var(--gold);
}

.gameweek-title {
    font-size: 24px;
    margin: 0 0 15px 0;
}

.gameweek-dates {
    font-size: 16px;
    opacity: 0.9;
    margin: 0 0 20px 0;
}

.gameweek-status {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* League Cards */
.league-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.league-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--primary-blue);
}

.league-card:hover {
    transform: translateY(-2px);
}

.league-card.private {
    border-left-color: var(--gold);
}

.league-card.sponsored {
    border-left-color: #28a745;
}

.league-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 10px 0;
}

.league-type {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 15px;
}

.league-type.public {
    color: var(--primary-blue);
}

.league-type.private {
    color: var(--gold);
}

.league-type.sponsored {
    color: #28a745;
}

.league-stats {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
    font-size: 14px;
}

.league-stat {
    text-align: center;
}

.league-stat-value {
    font-weight: 700;
    color: var(--navy);
    display: block;
    font-size: 18px;
}

.league-stat-label {
    color: var(--text-light);
    font-size: 12px;
}

/* User Stats Dashboard */
.user-stats-dashboard {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.user-stats-header {
    text-align: center;
    margin-bottom: 25px;
}

.user-stats-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 10px 0;
}

.user-stats-subtitle {
    color: var(--text-light);
    margin: 0;
}

.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.user-stat-card {
    text-align: center;
    padding: 20px;
    background: var(--light-gray);
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.user-stat-card:hover {
    background: #e9ecef;
}

.user-stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-blue);
    margin: 0 0 5px 0;
}

.user-stat-label {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tournament-grid,
    .league-grid {
        grid-template-columns: 1fr;
    }
    
    .user-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .leaderboard-entry {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 0;
    }
    
    .leaderboard-rank {
        margin-bottom: 10px;
    }
    
    .tournament-actions {
        flex-direction: column;
    }
    
    .gameweek-number {
        font-size: 36px;
    }
    
    .gameweek-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .user-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .gameweek-number {
        font-size: 28px;
    }
    
    .gameweek-title {
        font-size: 18px;
    }
}

/* Search Styles */
.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-container input {
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-container button {
    padding: 8px 12px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-container button:hover {
    background: var(--navy);
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-gray);
}

.search-results-header h3 {
    margin: 0;
    color: var(--navy);
}

.search-section {
    margin-bottom: 25px;
}

.search-section h4 {
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-size: 18px;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.search-result-card {
    background: var(--light-gray);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-blue);
    transition: transform 0.3s ease;
}

.search-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.search-result-card h5 {
    margin: 0 0 8px 0;
    color: var(--navy);
    font-size: 16px;
}

.search-result-card p {
    margin: 4px 0;
    color: var(--text-light);
    font-size: 14px;
}

.search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.search-no-results p {
    margin: 10px 0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    margin-top: 10px;
}

/* Mobile Search Styles */
@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
        width: 100%;
    }
    
    .search-container input {
        width: 100%;
        min-width: auto;
    }
    
    .search-results-grid {
        grid-template-columns: 1fr;
    }
    
    .search-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* Enhanced Search Styles */
.result-type-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 12px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.result-type-badge.heading {
    background: var(--primary-blue);
    color: var(--white);
}

.result-type-badge.navigation {
    background: var(--gold);
    color: var(--navy);
}

.result-type-badge.button {
    background: #28a745;
    color: var(--white);
}

.result-type-badge.section {
    background: #6c757d;
    color: var(--white);
}

.result-type-badge.paragraph {
    background: #17a2b8;
    color: var(--white);
}

.result-type-badge.tournament {
    background: var(--electric-blue);
    color: var(--white);
}

.result-type-badge.league {
    background: #fd7e14;
    color: var(--white);
}

.result-type-badge.text {
    background: #6f42c1;
    color: var(--white);
}

.result-type-badge.link {
    background: #20c997;
    color: var(--white);
}

.result-type-badge.list-item {
    background: #e83e8c;
    color: var(--white);
}

.result-type-badge.table-cell {
    background: #6c757d;
    color: var(--white);
}

.result-type-badge.span {
    background: #fd7e14;
    color: var(--white);
}

.result-type-badge.div {
    background: #6c757d;
    color: var(--white);
}

.result-type-badge.bold {
    background: #dc3545;
    color: var(--white);
}

.result-type-badge.italic {
    background: #ffc107;
    color: var(--navy);
}

.result-type-badge.small-text {
    background: #6c757d;
    color: var(--white);
}

.result-type-badge.label {
    background: #17a2b8;
    color: var(--white);
}

.result-type-badge.input {
    background: #28a745;
    color: var(--white);
}

.result-type-badge.textarea {
    background: #28a745;
    color: var(--white);
}

.result-type-badge.element {
    background: #6c757d;
    color: var(--white);
}

.result-type-badge.interactive {
    background: var(--electric-blue);
    color: var(--white);
}

.result-type-badge.form-element {
    background: #20c997;
    color: var(--white);
}

.result-type-badge.styled-content {
    background: #6f42c1;
    color: var(--white);
}

.result-type-badge.current-page {
    background: var(--primary-blue);
    color: var(--white);
}

.result-type-badge.other-page {
    background: #28a745;
    color: var(--white);
}

.search-suggestions {
    margin-top: 20px;
    padding: 15px;
    background: var(--light-gray);
    border-radius: 8px;
}

.search-suggestions h5 {
    margin: 0 0 10px 0;
    color: var(--navy);
    font-size: 14px;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-tag {
    padding: 4px 12px;
    background: var(--primary-blue);
    color: var(--white);
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggestion-tag:hover {
    background: var(--navy);
    transform: translateY(-1px);
}

/* Enhanced search result cards */
.search-result-card {
    background: var(--light-gray);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-blue);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.search-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-left-color: var(--navy);
}

.search-result-card h5 {
    margin: 0 0 8px 0;
    color: var(--navy);
    font-size: 16px;
    line-height: 1.3;
}

.search-result-card p {
    margin: 4px 0;
    color: var(--text-light);
    font-size: 14px;
}

.search-result-card .btn {
    margin-top: 10px;
}

.match-details {
    margin: 8px 0;
    padding: 8px;
    background: rgba(0, 71, 167, 0.05);
    border-radius: 4px;
    border-left: 3px solid var(--primary-blue);
}

.match-details small {
    color: var(--text-light);
    font-size: 11px;
    line-height: 1.4;
}

/* Language Switcher Styles - REMOVED */

/* Language change notification animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Mobile language switcher */
@media (max-width: 768px) {
    .top-language .dropdown-menu {
        right: 0;
        left: auto;
        min-width: 100px;
    }
    
    .top-language .dropdown-toggle {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .top-language .dropdown-toggle img {
        width: 16px;
        height: 12px;
    }
}

/* Mobile search enhancements */
@media (max-width: 768px) {
    .suggestion-tags {
        justify-content: center;
    }
    
    .search-result-card {
        padding: 12px;
    }
    
    .search-result-card h5 {
        font-size: 14px;
    }
    
    .result-type-badge {
        font-size: 9px;
        padding: 1px 6px;
    }
}
