/**
 * Waxpeer Price Tracker - Frontend Styles
 */

/* Track Button on Product Page */
.wpt-track-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #000 !important;
    border: none !important;
    padding: 12px 20px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin-left: 10px !important;
}

.wpt-track-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.wpt-track-btn.tracking {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #fff !important;
}

/* Modal */
.wpt-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wpt-modal {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    position: relative;
    color: #fff;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.wpt-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.wpt-modal-close:hover {
    color: #fff;
}

.wpt-modal h3 {
    margin: 0 0 10px;
    font-size: 24px;
    color: #fff;
}

.wpt-modal-product-name {
    color: #f59e0b;
    font-weight: 600;
    margin: 0 0 5px;
}

.wpt-modal-current-price {
    color: #9ca3af;
    margin: 0 0 20px;
}

.wpt-modal-current-price strong {
    color: #10b981;
    font-size: 18px;
}

.wpt-modal-form label {
    display: block;
    color: #9ca3af;
    margin-bottom: 8px;
    font-size: 14px;
}

.wpt-price-input {
    display: flex;
    align-items: center;
    background: #0a0a0a;
    border: 2px solid #333;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.wpt-price-input .currency {
    padding: 12px 15px;
    background: #333;
    color: #9ca3af;
    font-weight: 600;
}

.wpt-price-input input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 15px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    outline: none;
}

.wpt-price-input input::placeholder {
    color: #666;
}

.wpt-login-notice {
    background: #292524;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 15px;
}

.wpt-login-notice a {
    color: #f59e0b;
    font-weight: 600;
}

.wpt-email-notice {
    color: #9ca3af;
    font-size: 13px;
    margin-bottom: 15px;
}

.wpt-email-notice strong {
    color: #fff;
}

.wpt-modal-submit {
    width: 100%;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #000 !important;
    border: none !important;
    padding: 15px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
}

.wpt-modal-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
}

.wpt-modal-success {
    text-align: center;
    padding: 20px 0;
}

.wpt-modal-success .success-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    font-size: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.wpt-modal-success h4 {
    margin: 0 0 10px;
    color: #fff;
}

.wpt-modal-success p {
    color: #9ca3af;
    margin: 0 0 20px;
}

.wpt-modal-success .button {
    background: #333 !important;
    color: #fff !important;
    border: none !important;
}

/* My Account - Price Alerts Page */
.wpt-alerts-page {
    max-width: 900px;
}

.wpt-alerts-header {
    margin-bottom: 30px;
}

.wpt-alerts-header h3 {
    margin: 0 0 5px;
    font-size: 24px;
}

.wpt-alerts-header p {
    color: #666;
    margin: 0;
}

.wpt-no-alerts {
    text-align: center;
    padding: 60px 20px;
    background: #f9fafb;
    border-radius: 12px;
}

.wpt-no-alerts .empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.wpt-no-alerts p {
    margin: 0;
    color: #666;
}

.wpt-no-alerts .subtext {
    font-size: 14px;
    margin: 10px 0 20px;
}

.wpt-alerts-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.wpt-alerts-stats .stat {
    background: #f9fafb;
    padding: 15px 25px;
    border-radius: 8px;
    text-align: center;
}

.wpt-alerts-stats .stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.wpt-alerts-stats .stat-label {
    font-size: 13px;
    color: #666;
}

.wpt-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wpt-alert-item {
    display: grid;
    grid-template-columns: 70px 1fr auto auto auto;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.wpt-alert-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.wpt-alert-item.triggered {
    opacity: 0.7;
    background: #f9fafb;
}

.wpt-alert-item .alert-image {
    width: 70px;
    height: 55px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wpt-alert-item .alert-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.wpt-alert-item .alert-image .no-image {
    font-size: 24px;
}

.wpt-alert-item .alert-info {
    min-width: 0;
}

.wpt-alert-item .alert-name {
    display: block;
    font-weight: 600;
    color: #000 !important;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(200, 255, 255, 0.9);
    padding: 6px 10px;
    border-radius: 4px;
}

.wpt-alert-item .alert-name:hover {
    color: #000 !important;
    background: rgba(200, 255, 255, 1);
}

.wpt-alert-item .alert-game {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
}

.wpt-alert-item .alert-prices {
    text-align: right;
    min-width: 110px;
    flex-shrink: 0;
}

.wpt-alert-item .current-price {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.wpt-alert-item .current-price.price-down {
    color: #10b981;
}

.wpt-alert-item .current-price .arrow {
    color: #10b981;
}

.wpt-alert-item .target-price {
    font-size: 12px;
    color: #9ca3af;
}

.wpt-alert-item .alert-status {
    min-width: 85px;
    flex-shrink: 0;
}

.wpt-alert-item .badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    text-align: center;
}

.wpt-alert-item .badge.active {
    background: #fef3c7;
    color: #92400e;
}

.wpt-alert-item .badge.triggered {
    background: #d1fae5;
    color: #065f46;
}

.wpt-alert-item .alert-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.wpt-alert-item .alert-actions button {
    background: #f3f4f6;
    border: none;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.wpt-alert-item .alert-actions button:hover {
    background: #e5e7eb;
}

.wpt-alert-item .wpt-remove-alert:hover {
    background: #fee2e2;
}

/* Responsive */
@media (max-width: 768px) {
    .wpt-track-btn {
        margin-left: 0 !important;
        margin-top: 10px !important;
        width: 100%;
    }
    
    .wpt-alert-item {
        display: grid;
        grid-template-columns: 60px 1fr auto;
        grid-template-rows: auto auto;
        gap: 10px 12px;
        padding: 15px;
    }
    
    .wpt-alert-item .alert-image {
        width: 60px;
        height: 50px;
        grid-column: 1;
        grid-row: 1;
    }
    
    .wpt-alert-item .alert-info {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }
    
    .wpt-alert-item .alert-status {
        grid-column: 3;
        grid-row: 1;
        align-self: center;
    }
    
    .wpt-alert-item .alert-prices {
        grid-column: 1 / 3;
        grid-row: 2;
        text-align: left;
    }
    
    .wpt-alert-item .alert-actions {
        grid-column: 3;
        grid-row: 2;
        justify-content: flex-end;
        align-self: center;
    }
    
    .wpt-alerts-stats {
        flex-direction: column;
    }
}

/* Email Settings Section */
.wpt-email-settings {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.wpt-email-settings label {
    display: block;
    font-weight: 600;
    color: #0369a1;
    margin-bottom: 8px;
    font-size: 14px;
}

.wpt-email-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    border: 1px solid #f59e0b;
}

.wpt-email-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.wpt-email-row input[type="email"] {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.wpt-email-row input[type="email"]:focus {
    border-color: #0ea5e9;
    outline: none;
}

.wpt-email-row .button {
    background: #0ea5e9 !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.wpt-email-row .button:hover {
    background: #0284c7 !important;
}

.wpt-email-help {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}

/* Modal Warning */
.wpt-modal .wpt-email-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 13px;
    text-align: center;
}

.wpt-modal .wpt-email-warning a {
    color: #d97706;
    font-weight: 600;
}

/* Dark theme adjustments for email settings */
body.dark-mode .wpt-email-settings,
.woocommerce-account .wpt-email-settings {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .wpt-email-settings label,
.woocommerce-account .wpt-email-settings label {
    color: #38bdf8;
}

body.dark-mode .wpt-email-row input[type="email"],
.woocommerce-account .wpt-email-row input[type="email"] {
    background: #0f172a;
    border-color: #334155;
    color: #fff;
}

body.dark-mode .wpt-email-help,
.woocommerce-account .wpt-email-help {
    color: #94a3b8;
}

/* Dark Theme - Alert Items */
body.dark-mode .wpt-alert-item,
.woocommerce-account .wpt-alert-item {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.08);
}

body.dark-mode .wpt-alert-item .alert-name,
.woocommerce-account .wpt-alert-item .alert-name {
    color: #000 !important;
    background: rgba(200, 255, 255, 0.9);
}

body.dark-mode .wpt-alert-item .alert-name:hover,
.woocommerce-account .wpt-alert-item .alert-name:hover {
    color: #000 !important;
    background: rgba(200, 255, 255, 1);
}

body.dark-mode .wpt-alert-item .current-price,
.woocommerce-account .wpt-alert-item .current-price {
    color: #fff;
}

body.dark-mode .wpt-alert-item .badge.active,
.woocommerce-account .wpt-alert-item .badge.active {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

body.dark-mode .wpt-alert-item .badge.triggered,
.woocommerce-account .wpt-alert-item .badge.triggered {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

body.dark-mode .wpt-alert-item .alert-actions button,
.woocommerce-account .wpt-alert-item .alert-actions button {
    background: rgba(255,255,255,0.05);
    color: #9ca3af;
}

body.dark-mode .wpt-alert-item .alert-actions button:hover,
.woocommerce-account .wpt-alert-item .alert-actions button:hover {
    background: rgba(255,255,255,0.1);
}

body.dark-mode .wpt-alerts-stats .stat,
.woocommerce-account .wpt-alerts-stats .stat {
    background: rgba(255,255,255,0.03);
}

body.dark-mode .wpt-alerts-stats .stat-value,
.woocommerce-account .wpt-alerts-stats .stat-value {
    color: #fff;
}
