/* Help Modal Styles */

/* Help Button */
#helpButton {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: #f39c12;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#helpButton:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.6);
}

#helpButton span {
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Help Modal */
.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.help-modal.open {
    opacity: 1;
}

/* Help Modal Content - Updated for consistent height */
.help-modal-content {
    background-color: #2c3e50;
    border-radius: 10px;
    width: 80%;
    max-width: 900px; /* Slightly wider */
    height: 80vh; /* Fixed height as percentage of viewport */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    border: 2px solid #f39c12;
    animation: modalAppear 0.3s forwards;
}

.help-modal-header {
    background-color: #34495e;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f39c12;
    position: relative;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.help-modal-header h2 {
    color: #f39c12;
    margin: 0;
    font-size: 1.5rem;
    flex: 0 0 auto;
}

/* Update header styling */
.tabs {
    display: flex;
    gap: 8px;
    flex: 1 1 auto;
    justify-content: center;
    margin: 0 20px;
}

.tab-btn {
    background-color: #2c3e50;
    border: none;
    padding: 8px 20px;
    color: #ecf0f1;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
    border: 1px solid #3a506b;
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #f39c12;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-btn:hover {
    background-color: #3a506b;
}

.tab-btn:hover::after {
    transform: scaleX(0.5);
}

.tab-btn.active {
    background-color: #f39c12;
    color: #2c3e50;
    font-weight: bold;
    box-shadow: 0 -3px 10px rgba(0,0,0,0.1);
}

.tab-btn.active::after {
    transform: scaleX(1);
}

.close-btn {
    cursor: pointer;
    font-size: 28px;
    color: #ecf0f1;
    transition: color 0.3s;
    line-height: 1;
    flex: 0 0 auto;
    margin-left: 15px;
}

.close-btn:hover {
    color: #f39c12;
}

/* Content area with flex-grow to fill space */
.help-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex-grow: 1; /* Fill available space */
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
}

.tab-content {
    display: none;
    height: 100%;
    overflow-y: auto;
    padding-right: 10px;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s;
}

/* Symbols Tab */
.symbols-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
    padding-bottom: 20px;
    flex-grow: 1;
}

.symbol-card {
    background-color: #34495e;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #546e7a;
    height: 140px;
}

.symbol-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    border-color: #f39c12;
}

.symbol-card-layout {
    display: flex;
    height: 100%;
}

.symbol-large {
    width: 40%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.2) 100%);
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(255,255,255,0.1);
    box-shadow: inset -3px 0 10px rgba(0,0,0,0.1);
}

.symbol-text {
    font-size: 3.5rem;
    text-shadow: 0px 2px 5px rgba(0,0,0,0.5);
}

.symbol-details {
    width: 60%;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.symbol-name {
    font-weight: bold;
    text-transform: capitalize;
    font-size: 1.2rem;
    color: #f39c12;
    margin-bottom: 8px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
}

.symbol-values-list {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

.value-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
    border-bottom: 1px dashed rgba(255,255,255,0.1);
    align-items: center;
}

.value-row:last-child {
    border-bottom: none;
}

.match-length {
    font-weight: bold;
    color: #f39c12;
    font-size: 0.9rem;
    background-color: rgba(243, 156, 18, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

.value-amount {
    color: #2ecc71;
    font-weight: bold;
    font-size: 1.1rem;
}

.special-description {
    padding: 10px 5px;
    text-align: center;
    font-style: italic;
    line-height: 1.5;
    color: #f39c12;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background-color: rgba(243, 156, 18, 0.1);
    border-radius: 5px;
}

/* Paylines Tab */
.paylines-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 15px;
    padding-bottom: 20px;
    flex-grow: 1;
}

.payline-card {
    background-color: #34495e;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid #546e7a;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.payline-card:hover {
    transform: translateY(-5px);
    border-color: #f39c12;
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.payline-name {
    font-weight: bold;
    margin-bottom: 8px;
    color: #f39c12;
}

.payline-grid {
    display: grid;
    width: 100%;
    aspect-ratio: 5/3;
    gap: 2px;
}

.payline-cell {
    border: 1px solid #546e7a;
    border-radius: 2px;
}

.payline-cell.active {
    opacity: 0.8;
}

.payline-note {
    grid-column: 1 / -1;
    text-align: center;
    font-style: italic;
    color: #95a5a6;
    margin-top: 15px;
}

/* Rules Tab */
#rules-tab h3 {
    color: #f39c12;
    border-bottom: 1px solid #546e7a;
    padding-bottom: 8px;
    margin-top: 20px;
    margin-bottom: 15px;
}

#rules-tab ul {
    list-style-type: square;
    padding-left: 20px;
}

#rules-tab li {
    margin-bottom: 8px;
    line-height: 1.4;
}

#rules-tab p {
    line-height: 1.5;
    margin-bottom: 15px;
}

/* Footer with checkbox */
.help-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #546e7a;
    background-color: #34495e;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0; /* Prevent footer from shrinking */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

/* Styled checkbox container */
.startup-checkbox {
    position: relative;
    padding-left: 35px;
    cursor: pointer;
    font-size: 16px;
    user-select: none;
    color: #ecf0f1;
    display: flex;
    align-items: center;
}

/* Hide the browser's default checkbox */
.startup-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Custom checkbox */
.checkmark {
    position: absolute;
    left: 0;
    height: 22px;
    width: 22px;
    background-color: #2c3e50;
    border: 2px solid #546e7a;
    border-radius: 4px;
    transition: all 0.2s;
}

/* On hover */
.startup-checkbox:hover .checkmark {
    border-color: #f39c12;
}

/* When checked */
.startup-checkbox input:checked ~ .checkmark {
    background-color: #f39c12;
    border-color: #f39c12;
}

/* Create the checkmark (hidden when not checked) */
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

/* Show the checkmark when checked */
.startup-checkbox input:checked ~ .checkmark:after {
    display: block;
}

/* Style the checkmark */
.startup-checkbox .checkmark:after {
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Checkbox label text */
.checkbox-label {
    margin-left: 10px;
}

/* Animation for the checkbox */
.startup-checkbox input:checked ~ .checkmark {
    animation: pulse 0.4s;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Animations */
@keyframes modalAppear {
    from {
        transform: scale(0.9);
    }
    to {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #helpButton {
        width: 36px;
        height: 36px;
        top: 10px;
        right: 10px;
    }
    
    .help-modal-content {
        width: 95%;
        height: 90vh;
    }
    
    .help-modal-body {
        padding: 15px;
    }
    
    .symbols-container {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 15px;
    }
    
    .tab-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Animation for tab transitions */
@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content.active {
    animation: tabFadeIn 0.3s forwards;
}