/**
 * Styles for custom Select2 dropdowns
 * For Minecraft Cart 2025 template
 */

/* Reset any default select styles */
select {
    display: block;
    width: 100%;
    background-color: #040d24;
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: white;
    border-radius: 0.5rem;
    padding: 10px;
    margin-bottom: 15px;
}

/* Properly hide select elements when custom dropdown is applied */
select.custom-select-hidden {
    position: absolute !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Hide any Select2 containers */
.select2-container {
    display: none !important;
}

/* Custom dropdown container */
.custom-select-container {
    position: relative;
    display: block;
    width: 100%;
    margin-bottom: 15px;
    z-index: 50; /* Base z-index for most dropdowns */
}

.custom-select-container.config-option-dropdown {
    width: 87%;
}

@media (max-width: 768px) {
    .col-sm-6 {
        max-width: 100% !important;
        width: 100% !important;
        flex: none !important;
        margin-left: 0 !important;
    }
}

/* Higher z-index for server type dropdown specifically */
.server-type-dropdown {
    z-index: 1000 !important; /* Much higher to ensure it's above other dropdowns */
}

/* Custom dropdown header */
.custom-select-header {
    background-color: #081638;
    color: white;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 0.5rem;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.custom-select-header:hover {
    border-color: rgba(0, 240, 255, 0.6);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

/* Dropdown arrow */
.custom-select-arrow {
    border: solid rgba(0, 240, 255, 0.8);
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    margin-left: 10px;
    transition: transform 0.3s;
}

.custom-select-container.open .custom-select-arrow {
    transform: rotate(-135deg);
}

/* Dropdown options container */
.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 999;
    margin-top: 5px;
    background-color: #040d24;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 0.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.server-type-dropdown .custom-select-options {
    z-index: 1001 !important;
}

.custom-select-container.open .custom-select-options {
    display: block;
}

/* Search box styling */
.custom-select-search {
    padding: 10px;
    position: sticky;
    top: 0;
    background-color: #081638;
    z-index: 10;
    border-bottom: 1px solid rgba(0, 240, 255, 0.3);
}

.custom-select-search-input {
    width: 100%;
    padding: 8px 12px;
    background-color: #040d24;
    color: white;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 0.3rem;
    outline: none;
    font-size: 14px;
}

.custom-select-search-input:focus {
    border-color: rgba(0, 240, 255, 0.8);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

.custom-select-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Individual options */
.custom-select-option {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
    display: flex;
    align-items: center;
    color: white;
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option:hover, 
.custom-select-option.selected {
    background-color: rgba(0, 240, 255, 0.1);
}

/* Server Type Dropdown */
.server-type-dropdown {
    width: 100%;
    margin-bottom: 20px;
}

.server-type-dropdown .custom-select-header {
    border: 2px solid rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    font-weight: 500;
}

/* Server type icons */
.server-type-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

/* Category styling */
.custom-select-category {
    padding: 6px 16px;
    font-size: 0.8em;
    font-weight: bold;
    color: rgba(0, 240, 255, 0.8);
    background-color: #071128;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.custom-select-category-container {
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
}

.custom-select-category-container:last-child {
    border-bottom: none;
}

/* Server icons */
.paper-icon { background-color: #3498db; }
.spigot-icon { background-color: #f1c40f; }
.vanilla-icon { background-color: #2ecc71; }
.forge-icon { background-color: #e74c3c; }
.fabric-icon { background-color: #9b59b6; }
.bukkit-icon { background-color: #e67e22; }
.sponge-icon { background-color: #1abc9c; }
.mohist-icon { background-color: #8e44ad; }
.purpur-icon { background-color: #9b59b6; }
.modpack-icon {
    width: 32px !important;
    height: 32px !important;
    margin-right: 10px;
    border-radius: 4px;
    object-fit: cover;
    vertical-align: middle;
}
.other-icon { background-color: #95a5a6; }

/* Highlight matching text during search */
.highlight-match {
    background-color: rgba(0, 240, 255, 0.2);
    font-weight: bold;
}

/* Loading state */
.custom-select-container.loading .custom-select-header::after {
    content: "";
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 240, 255, 0.3);
    border-top-color: rgba(0, 240, 255, 0.8);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Scrollbar styling */
.custom-select-options::-webkit-scrollbar {
    width: 8px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: #040d24;
    border-radius: 4px;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.3);
    border-radius: 4px;
}

.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 240, 255, 0.5);
}

/* Custom styles for the info alert box */
.alert.alert-warning.info-text-sm {
    background-color: #081638;
    color: white;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 0.5rem;
    padding: 15px;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.alert.alert-warning.info-text-sm i {
    color: rgba(0, 240, 255, 0.8);
    margin-right: 8px;
}

/* Update the alert link hover effects to remove box-shadow */
.alert-link, a.alert-link, .alert a, .alert-warning a, 
.info-text-sm a, .alert.alert-warning.info-text-sm a,
.alert.alert-warning.info-text-sm .alert-link {
    cursor: pointer !important;
    display: inline-block !important;
    position: relative !important;
    color: #00F0FF !important;
    text-decoration: underline !important;  /* Always underline for visibility */
    font-weight: bold !important;
    transition: all 0.2s ease !important;
    border-bottom: none !important; /* Remove dotted border */
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.alert-link:hover, a.alert-link:hover, .alert a:hover, 
.alert-warning a:hover, .info-text-sm a:hover,
.alert.alert-warning.info-text-sm a:hover,
.alert.alert-warning.info-text-sm .alert-link:hover {
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.6) !important;
    color: #00F0FF !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Billing Cycle Dropdown */
.billing-cycle-dropdown {
    width: 40% !important;
    z-index: 500 !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    margin-left: 2%;
  }

@media (max-width: 768px) {
    .billing-cycle-dropdown {
        width: 96% !important;
        margin-left: 2%;
        margin: 0 autp 15px auto; 
    }
}
  
.billing-cycle-dropdown .custom-select-header,
.billing-cycle-dropdown .custom-select-options {
    width: 100% !important;
}

/* Config Options Dropdown */
.config-option-dropdown .custom-select-options {
    min-width: 100%; 
    width: auto;
}

/* Active/Open dropdown containers */
.custom-select-container.open {
    z-index: 1500 !important; /* Ensure open dropdowns are above everything else */
    position: relative;
}

/* Active/Open dropdown option containers */
.custom-select-container.open .custom-select-options {
    z-index: 1501 !important; /* Ensure dropdown options are above everything */
    max-height: 350px; /* Slightly taller to show more options */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5); /* More pronounced shadow */
}

/* RAM Warning Message */
.ram-warning-message {
    background-color: rgba(255, 87, 34, 0.1) !important;
    border: 1px solid rgba(255, 87, 34, 0.3) !important;
    color: white !important;
    border-radius: 0.5rem !important;
    padding: 15px !important;
    margin-top: 15px !important;
    margin-bottom: 15px !important;
    font-size: 0.9rem !important;
    animation: pulse-warning 2s infinite ease-in-out;
    display: flex;
    align-items: center; /* Center items vertically */
}

.ram-warning-message i {
    color: #ff5722 !important;
    margin-right: 10px !important;
    font-size: 1.2rem !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ram-warning-message > div {
    flex: 1;
    display: flex;
    align-items: center;
}

.ram-warning-message p {
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

.ram-warning-message strong {
    font-weight: bold;
    color: #ff5722 !important;
    margin-right: 5px;
}

@keyframes pulse-warning {
    0% { box-shadow: 0 0 0 0 rgba(255, 87, 34, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(255, 87, 34, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 87, 34, 0); }
}

