/**
 * ChartUpgrades License Manager - Public Styles
 * Dark Trading Platform Theme
 *
 * @package ChartUpgrades_License_Validator
 */

/* ==========================================================================
   License Manager Container
   ========================================================================== */

.chartupgrades-license-manager {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ==========================================================================
   Section Cards
   ========================================================================== */

.chartupgrades-section {
    background: linear-gradient(145deg, rgba(30, 30, 45, 0.8) 0%, rgba(18, 20, 26, 0.9) 100%);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.chartupgrades-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1976D2 0%, #00D9FF 100%);
}

.chartupgrades-section h2 {
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.5rem;
    font-weight: 700;
    color: #E8E8E8;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chartupgrades-section h2::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #00D9FF;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(0, 217, 255, 0.6);
}

.chartupgrades-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #E8E8E8;
    margin: 0 0 1rem 0;
}

.chartupgrades-section p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0 0 1rem 0;
}

/* ==========================================================================
   Slot Counter & Stats
   ========================================================================== */

.chartupgrades-section > p:first-of-type {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(0, 217, 255, 0.08);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.chartupgrades-section > p:first-of-type .button {
    margin-left: auto !important;
}

/* ==========================================================================
   Add Machine ID Form
   ========================================================================== */

.chartupgrades-add-machine-id {
    background: rgba(10, 10, 15, 0.6);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    position: relative;
}

.chartupgrades-add-machine-id::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #B84000 0%, #FF6B35 100%);
    border-radius: 12px 12px 0 0;
}

.chartupgrades-add-machine-id h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.chartupgrades-add-machine-id h3::before {
    content: '+';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #B84000 0%, #D04A00 100%);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.chartupgrades-add-machine-id form p {
    margin-bottom: 1.25rem;
}

.chartupgrades-add-machine-id label {
    display: block;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.chartupgrades-add-machine-id input[type="text"] {
    width: 100%;
    max-width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(26, 26, 37, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9375rem;
    color: #E8E8E8;
    transition: all 0.2s ease;
}

.chartupgrades-add-machine-id input[type="text"]:focus {
    outline: none;
    border-color: #00D9FF;
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.15);
    background: rgba(18, 20, 26, 0.9);
}

.chartupgrades-add-machine-id input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.chartupgrades-add-machine-id small {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8125rem;
    margin-top: 0.5rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.chartupgrades-license-manager .button,
.chartupgrades-license-manager button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #B84000 0%, #D04A00 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    white-space: nowrap;
}

.chartupgrades-license-manager .button:hover,
.chartupgrades-license-manager button.button:hover {
    background: linear-gradient(135deg, #D04A00 0%, #E65A10 100%);
    box-shadow: 0 4px 20px rgba(184, 64, 0, 0.4);
    transform: translateY(-2px);
    color: white;
}

.chartupgrades-license-manager .button.small,
.chartupgrades-license-manager button.button.small {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.chartupgrades-license-manager .button.button-primary {
    background: linear-gradient(135deg, #1976D2 0%, #42A5F5 100%);
}

.chartupgrades-license-manager .button.button-primary:hover {
    background: linear-gradient(135deg, #42A5F5 0%, #64B5F6 100%);
    box-shadow: 0 4px 20px rgba(25, 118, 210, 0.4);
}

.remove-machine-id {
    background: rgba(255, 82, 82, 0.15) !important;
    border: 1px solid rgba(255, 82, 82, 0.3) !important;
    color: #FF5252 !important;
}

.remove-machine-id:hover {
    background: rgba(255, 82, 82, 0.25) !important;
    border-color: #FF5252 !important;
    box-shadow: 0 4px 15px rgba(255, 82, 82, 0.3) !important;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.chartupgrades-license-manager .woocommerce-table,
.chartupgrades-license-manager table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chartupgrades-license-manager table thead th {
    padding: 1rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(10, 10, 15, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.chartupgrades-license-manager table tbody td {
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
    color: #E8E8E8;
    background: rgba(18, 20, 26, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.chartupgrades-license-manager table tbody tr:last-child td {
    border-bottom: none;
}

.chartupgrades-license-manager table tbody tr:hover td {
    background: rgba(30, 30, 45, 0.8);
}

.chartupgrades-license-manager table td a {
    color: #00D9FF;
    font-weight: 500;
    transition: color 0.2s ease;
}

.chartupgrades-license-manager table td a:hover {
    color: #42A5F5;
}

/* Machine ID Code */
.chartupgrades-license-manager code {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8125rem;
    color: #00D9FF;
    user-select: all;
}

/* Status Badges */
.chartupgrades-license-manager td span[style*="color: green"],
.chartupgrades-license-manager .status-active {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 200, 83, 0.15);
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #00C853 !important;
}

.chartupgrades-license-manager td span[style*="color: green"]::before,
.chartupgrades-license-manager .status-active::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #00C853;
    border-radius: 50%;
    animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.chartupgrades-license-manager td span[style*="color: red"],
.chartupgrades-license-manager .status-inactive {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 82, 82, 0.15);
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #FF5252 !important;
}

/* ==========================================================================
   Search Input
   ========================================================================== */

.chartupgrades-license-manager input[type="search"],
.chartupgrades-license-manager input#license-search,
.chartupgrades-license-manager input#indicator-search {
    width: 100%;
    max-width: 400px;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background: rgba(26, 26, 37, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 0.9375rem;
    color: #E8E8E8;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.875rem center;
}

.chartupgrades-license-manager input[type="search"]:focus,
.chartupgrades-license-manager input#license-search:focus,
.chartupgrades-license-manager input#indicator-search:focus {
    outline: none;
    border-color: #00D9FF;
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.15);
    background-color: rgba(18, 20, 26, 0.9);
}

.chartupgrades-license-manager input[type="search"]::placeholder,
.chartupgrades-license-manager input#license-search::placeholder,
.chartupgrades-license-manager input#indicator-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#indicator-count {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.8125rem !important;
}

/* ==========================================================================
   Subscription Indicator Selection
   ========================================================================== */

.chartupgrades-subscription-selection::before {
    background: linear-gradient(90deg, #9C27B0 0%, #E040FB 100%);
}

.chartupgrades-subscription-selection h2::before {
    background: #E040FB;
    box-shadow: 0 0 12px rgba(224, 64, 251, 0.6);
}

.chartupgrades-indicator-list {
    max-height: 500px;
    overflow-y: auto;
    background: rgba(10, 10, 15, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    padding: 0 !important;
    margin: 1.5rem 0 !important;
}

.chartupgrades-indicator-list::-webkit-scrollbar {
    width: 8px;
}

.chartupgrades-indicator-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.chartupgrades-indicator-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.chartupgrades-indicator-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.indicator-option {
    padding: 1rem 1.25rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    transition: background 0.2s ease;
}

.indicator-option:last-child {
    border-bottom: none !important;
}

.indicator-option:hover {
    background: rgba(255, 255, 255, 0.03);
}

.indicator-option label {
    display: flex !important;
    align-items: flex-start !important;
    gap: 1rem;
    cursor: pointer;
    color: #E8E8E8;
}

.indicator-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0 !important;
    margin-top: 2px !important;
    accent-color: #00D9FF;
    cursor: pointer;
    flex-shrink: 0;
}

.indicator-option strong {
    color: #E8E8E8 !important;
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
}

.indicator-option small {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.8125rem !important;
    line-height: 1.5;
}

/* Selection Feedback */
.selection-feedback {
    font-size: 0.875rem;
    font-weight: 500;
}

/* ==========================================================================
   Empty States
   ========================================================================== */

.chartupgrades-section > p:last-child:not(:first-child) {
    padding: 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .chartupgrades-section {
        padding: 1.5rem;
    }

    .chartupgrades-section h2 {
        font-size: 1.25rem;
    }

    .chartupgrades-add-machine-id {
        padding: 1.25rem;
    }

    .chartupgrades-license-manager table {
        display: block;
        overflow-x: auto;
    }

    .chartupgrades-license-manager table thead {
        display: none;
    }

    .chartupgrades-license-manager table tbody tr {
        display: block;
        margin-bottom: 1rem;
        background: rgba(18, 20, 26, 0.8);
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .chartupgrades-license-manager table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.875rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .chartupgrades-license-manager table tbody td::before {
        content: attr(data-label);
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: rgba(255, 255, 255, 0.5);
    }

    .chartupgrades-license-manager table tbody tr:last-child {
        margin-bottom: 0;
    }

    .chartupgrades-license-manager input[type="search"],
    .chartupgrades-license-manager input#license-search,
    .chartupgrades-license-manager input#indicator-search {
        max-width: 100%;
    }

    .chartupgrades-section > p:first-of-type {
        flex-direction: column;
        align-items: flex-start;
    }

    .chartupgrades-section > p:first-of-type .button {
        margin-left: 0 !important;
        margin-top: 0.5rem;
    }
}
