/* RacquetSportsConnect - Custom Styles */

:root {
    --primary-color: #FF6B35;
    --secondary-color: #533483;
    --dark-color: #0f3460;
    --danger-color: #dc3545;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --text-dark: #1a1a1a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* Navigation Bar */
.navbar {
    background: linear-gradient(90deg, #1a1a1a 0%, #000000 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: white !important;
    text-decoration: none !important;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C5A 100%);
    padding: 6px 16px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.navbar-brand:hover {
    text-decoration: none !important;
    background: linear-gradient(135deg, #e55a2b 0%, #FF6B35 100%);
    transform: scale(1.02);
}

.navbar-brand i {
    color: white;
    margin-right: 8px;
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    transition: color 0.3s;
    text-decoration: none !important;
}

.navbar .nav-link:hover {
    color: var(--primary-color) !important;
    text-decoration: none !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: relative;
    overflow: hidden;
    color: white;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #e0e0e0;
}

/* Cards */
.card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.modern-card {
    transition: all 0.3s ease;
}

.modern-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-body {
    padding: 1.5rem;
}

.card-header {
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

/* Feature Card */
.feature-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.feature-card-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C5A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: rgba(255, 255, 255, 0.3);
}

.feature-card-header {
    padding: 20px;
}

.feature-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.feature-card-price {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #757575;
    font-weight: 600;
}

.feature-card-body {
    padding: 0 20px 20px;
    border-bottom: 1px solid #e9ecef;
}

.feature-card-footer {
    padding: 15px 20px;
}

/* Buttons */
.btn-explore {
    background-color: var(--primary-color) !important;
    color: white !important;
    padding: 14px 36px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    text-decoration: none;
    border: none !important;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-explore:hover {
    background-color: #e55a24 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #e55a24 !important;
    border-color: #e55a24 !important;
    transform: translateY(-2px);
}

.btn-outline-light {
    border: 2px solid white !important;
    color: white !important;
    padding: 14px 36px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    background-color: white !important;
    color: var(--primary-color) !important;
}

.btn-sm {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.8rem !important;
    border-radius: 4px !important;
}

/* Form Input Styling */
.form-control {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

/* Alert Styling */
.alert {
    border-radius: 6px;
    border: 1px solid transparent;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Text Styling */
.text-muted {
    color: #6c757d !important;
}

.text-center {
    text-align: center;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 1rem;
}

.modal-header .modal-title {
    color: inherit;
}

/* Prevent global heading dark color from overriding white text in gradient card headers */
.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6,
.card-header .modal-title {
    color: inherit;
}

/* Badge Styling */
.badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
}

.badge.bg-light {
    background-color: #e9ecef !important;
    color: #333 !important;
}

/* Icon Styling */
.fa-racquet {
    color: var(--primary-color);
}

/* Checkbox Styling */
.form-check-input {
    width: 1.25em;
    height: 1.25em;
    margin-top: 0.3em;
    vertical-align: top;
    border: 1px solid #dee2e6;
    border-radius: 0.25em;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    margin-left: 0.5rem;
    cursor: pointer;
}

/* Link Styling */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #e55a24;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #0f3460 0%, #1a1a2e 100%);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: auto;
}

footer p {
    margin-bottom: 0;
}

/* Spinner */
.spinner-border {
    color: var(--primary-color) !important;
}

/* Responsive */
@media (max-width: 992px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }

    .hero-section h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .card-body {
        padding: 1.25rem;
    }

    h1, h2 {
        font-size: 1.5rem;
    }

    .hero-section {
        min-height: 400px !important;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section h2 {
        font-size: 1.5rem;
    }

    .btn-explore {
        padding: 12px 24px !important;
        font-size: 0.95rem !important;
    }
}

@media (max-width: 576px) {
    .card-body {
        padding: 1rem;
    }

    h1, h2 {
        font-size: 1.25rem;
    }

    .hero-section h1 {
        font-size: 1.5rem;
    }

    .hero-section h2 {
        font-size: 1.2rem;
    }
}

/* Demo Credentials Box */
.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    color: #0c5460;
    margin-top: 1rem;
}

.alert-info strong {
    font-weight: 600;
}

/* Link Styling */
a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Checkbox Styling */
.form-check-input {
    width: 1.25em;
    height: 1.25em;
    margin-top: 0.3em;
    vertical-align: top;
    border: 1px solid #dee2e6;
    border-radius: 0.25em;
    background-color: #fff;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    margin-left: 0.5rem;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 576px) {
    .card-body {
        padding: 1.5rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

/* IP Tag / Token Chooser */
.ip-tag-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    min-height: 31px;
    cursor: text;
    background: #fff;
}
.ip-tag-container:focus-within {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
}
.ip-tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 8px;
    background: var(--secondary-color);
    color: #fff;
    border-radius: 12px;
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: nowrap;
}
.ip-tag .ip-tag-remove {
    display: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    line-height: 1;
    margin-left: 2px;
    opacity: 0.7;
}
.ip-tag .ip-tag-remove:hover { opacity: 1; }
.ip-tag:hover .ip-tag-remove { display: inline; }
.ip-tag-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 120px;
    font-size: 0.875rem;
    padding: 2px 0;
    background: transparent;
}
.ip-badge {
    display: inline-block;
    padding: 1px 6px;
    background: var(--secondary-color);
    color: #fff;
    border-radius: 10px;
    font-size: 0.7rem;
    margin: 1px;
}

/* ── Ask Ernie Chat Widget ── */
#ernie-chat-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1050;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}
#ernie-chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}
#ernie-chat-bubble .ernie-sprite {
    width: 132px;
    height: 88px;
    background-size: 200% 200%;
    background-position: 0% 0%;
    background-repeat: no-repeat;
    animation: ernieExpressions 40s steps(1) infinite;
}
@keyframes ernieExpressions {
    0%, 25%    { background-position: 0% 0%; }
    25.01%, 50%   { background-position: 100% 0%; }
    50.01%, 75%   { background-position: 0% 100%; }
    75.01%, 100%  { background-position: 100% 100%; }
}
#ernie-chat-bubble .badge-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    background: var(--success-color);
    border: 2px solid #fff;
    border-radius: 50%;
}

#ernie-chat-panel {
    position: fixed;
    bottom: 96px;
    right: 24px;
    z-index: 1050;
    width: 380px;
    max-height: 520px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
}
#ernie-chat-panel.open {
    display: flex;
}
#ernie-chat-panel .ernie-header {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
#ernie-chat-panel .ernie-header .ernie-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
#ernie-chat-panel .ernie-header .ernie-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
#ernie-chat-panel .ernie-header .ernie-title {
    flex: 1;
}
#ernie-chat-panel .ernie-header .ernie-title h6 {
    margin: 0;
    font-weight: 700;
    color: inherit;
}
#ernie-chat-panel .ernie-header .ernie-title small {
    opacity: 0.8;
    font-size: 0.75rem;
}
#ernie-chat-panel .ernie-header .ernie-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 0;
    line-height: 1;
}
#ernie-chat-panel .ernie-header .ernie-close:hover {
    opacity: 1;
}

#ernie-chat-panel .ernie-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-height: 280px;
    max-height: 360px;
    background: #f8f9fa;
}
#ernie-chat-panel .ernie-msg {
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
}
#ernie-chat-panel .ernie-msg.bot {
    justify-content: flex-start;
}
#ernie-chat-panel .ernie-msg.user {
    justify-content: flex-end;
}
#ernie-chat-panel .ernie-msg .msg-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.4;
    word-wrap: break-word;
}
#ernie-chat-panel .ernie-msg.bot .msg-bubble {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
    border-top-left-radius: 4px;
}
#ernie-chat-panel .ernie-msg.user .msg-bubble {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}
#ernie-chat-panel .ernie-msg .msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
#ernie-chat-panel .ernie-msg .msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
#ernie-chat-panel .ernie-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    border-top-left-radius: 4px;
    width: fit-content;
}
#ernie-chat-panel .ernie-typing span {
    width: 6px;
    height: 6px;
    background: #aaa;
    border-radius: 50%;
    animation: ernieTyping 1.2s infinite;
}
#ernie-chat-panel .ernie-typing span:nth-child(2) { animation-delay: 0.2s; }
#ernie-chat-panel .ernie-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ernieTyping {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

#ernie-chat-panel .ernie-input {
    padding: 12px 16px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 8px;
    background: #fff;
    flex-shrink: 0;
}
#ernie-chat-panel .ernie-input input {
    flex: 1;
    border: 1px solid #dee2e6;
    border-radius: 24px;
    padding: 8px 16px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}
#ernie-chat-panel .ernie-input input:focus {
    border-color: var(--primary-color);
}
#ernie-chat-panel .ernie-input button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: transform 0.15s;
    flex-shrink: 0;
}
#ernie-chat-panel .ernie-input button:hover {
    transform: scale(1.08);
}
#ernie-chat-panel .ernie-footer-note {
    text-align: center;
    font-size: 0.68rem;
    color: #999;
    padding: 4px 16px 8px;
    background: #fff;
}

@media (max-width: 480px) {
    #ernie-chat-panel {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 88px;
        max-height: 70vh;
    }
}
