/*
 * HairColorGPT UMP Integration - User Account Styles
 * 
 * @package    HairColorGPT_UMP_Integration
 * @subpackage HairColorGPT_UMP_Integration/assets/css
 * @since      1.0.0
 */

/* ========================================
   Dashboard Layout
   ======================================== */

.hcgpt-user-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
}

.dashboard-header h2 {
    margin: 0 0 10px 0;
    font-size: 32px;
    font-weight: 600;
}

.last-login {
    opacity: 0.9;
    font-size: 14px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* ========================================
   Dashboard Cards
   ======================================== */

.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e1e5e9;
    transition: transform 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
}

.dashboard-card h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 10px;
}

/* ========================================
   Membership Card
   ======================================== */

.membership-card {
}

.membership-card.hcgpt-card {
    padding: 0;
    background: var(--hcgpt-color-surface);
    border: 1px solid var(--hcgpt-color-border);
    border-radius: var(--hcgpt-radius-lg);
}

.membership-card.hcgpt-card:hover {
    transform: none;
}

.membership-card .hcgpt-card__header {
    justify-content: space-between;
}

/* ========================================
   Usage Card
   ======================================== */

.usage-card {
    position: relative;
}

.usage-item {
    margin-bottom: 20px;
}

.usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.usage-label {
    font-weight: 600;
    color: #495057;
}

.usage-count {
    font-size: 14px;
    color: #6c757d;
}

.usage-bar {
    background: #e9ecef;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.usage-progress {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.usage-chart {
    margin: 30px 0 20px 0;
    height: 200px;
}

.view-detailed-stats {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.view-detailed-stats:hover {
    background: #5a6268;
}

/* ========================================
   Preferences Card
   ======================================== */

.preferences-card form {
    margin-bottom: 20px;
}

.preference-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.preference-row label {
    font-weight: 600;
    min-width: 100px;
    color: #495057;
}

.preference-row select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

.save-preferences {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.save-preferences:hover {
    background: #005a87;
}

.full-preferences-link a {
    color: #007cba;
    text-decoration: none;
    font-size: 14px;
}

.full-preferences-link a:hover {
    text-decoration: underline;
}

/* ========================================
   Activity Card
   ======================================== */

.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px solid #f1f3f4;
    gap: 15px;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 5px;
}

.activity-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #6c757d;
}

.no-activity {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
    font-style: italic;
}

.view-all-activity a {
    color: #007cba;
    text-decoration: none;
    font-size: 14px;
}

.view-all-activity a:hover {
    text-decoration: underline;
}

/* ========================================
   Dashboard Actions
   ======================================== */

.dashboard-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.primary-action {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.primary-action:hover {
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

.secondary-action {
    background: transparent;
    color: #6c757d;
    padding: 15px 30px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.secondary-action:hover {
    background: #f8f9fa;
    border-color: #6c757d;
    color: #495057;
    text-decoration: none;
}

/* ========================================
   Notifications
   ======================================== */

.hcgpt-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.hcgpt-notification.success {
    background: #28a745;
}

.hcgpt-notification.error {
    background: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   Usage Dashboard Modals (owner: UMP)
   ======================================== */

#stats-modal,
#detailed-stats-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.45);
    z-index: 100000;
}

#stats-modal.active,
#detailed-stats-modal.active {
    display: flex;
}

#stats-modal .modal-content,
#detailed-stats-modal .modal-content {
    width: min(92vw, 720px);
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2);
}

#stats-modal .modal-header,
#detailed-stats-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #e5e7eb;
}

#stats-modal .modal-header h3,
#detailed-stats-modal .modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #1f2937;
}

#stats-modal .modal-close,
#detailed-stats-modal .modal-close {
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    padding: 0 4px;
}

#stats-modal .modal-body,
#detailed-stats-modal .modal-body {
    padding: 20px;
}

#stats-modal .chart-period-selector {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 12px;
}

@media (max-width: 767.98px) {
    #stats-modal .modal-content,
    #detailed-stats-modal .modal-content {
        width: 100%;
        max-height: 96vh;
    }

    #stats-modal .modal-header,
    #detailed-stats-modal .modal-header {
        padding: 14px 16px;
    }

    #stats-modal .modal-body,
    #detailed-stats-modal .modal-body {
        padding: 16px;
    }
}

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

@media (max-width: 767.98px) {
    .hcgpt-user-dashboard {
        padding: 15px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dashboard-header {
        padding: 20px;
    }
    
    .dashboard-header h2 {
        font-size: 24px;
    }
    
    .dashboard-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .preference-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .preference-row label {
        min-width: auto;
    }
    
    .preference-row select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .dashboard-card {
        padding: 20px;
    }
    
    .activity-item {
        gap: 10px;
    }
    
    .activity-icon {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

/* ========================================
   Personalized Chat Styles
   ======================================== */

.hcgpt-personalized-chat {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.hcgpt-usage-status {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.hcgpt-usage-status h4 {
    margin: 0 0 15px 0;
    color: #495057;
}

.usage-bars .usage-item {
    margin-bottom: 15px;
}

.hcgpt-preferences-section {
    padding: 25px;
    border-bottom: 1px solid #e9ecef;
}

.preference-group {
    margin-bottom: 20px;
}

.preference-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.preference-group select,
.preference-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

.preference-group textarea {
    resize: vertical;
    min-height: 80px;
}

.save-preferences-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.save-preferences-btn:hover {
    background: #005a87;
}

.hcgpt-chat-interface {
    padding: 25px;
}

.chat-messages {
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.welcome-message {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
}

.premium-features-notice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 14px;
}

.chat-input-area {
    margin-top: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-group textarea {
    flex: 1;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    resize: none;
    font-size: 14px;
}

.send-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.send-button:hover {
    background: #218838;
}

.premium-features {
    display: flex;
    gap: 20px;
    font-size: 14px;
}

.premium-features label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.hcgpt-status-message {
    padding: 10px;
    border-radius: 6px;
    margin-top: 15px;
    text-align: center;
    font-weight: 500;
}

/* ========================================
   Membership Status Styles
   ======================================== */

.hcgpt-user-account .hcgpt-membership-status {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.hcgpt-user-account .membership-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    text-align: center;
}

.hcgpt-user-account .membership-details {
    padding: 30px;
    border-bottom: 1px solid #e9ecef;
}

.hcgpt-user-account .membership-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f4;
}

.hcgpt-user-account .membership-detail:last-child {
    border-bottom: none;
}

.hcgpt-user-account .detail-label {
    font-weight: 600;
    color: #495057;
}

.hcgpt-user-account .detail-value {
    color: #6c757d;
}

.hcgpt-user-account .expiry-warning {
    color: #ffc107;
    font-weight: 600;
}

.hcgpt-user-account .expiry-expired {
    color: #dc3545;
    font-weight: 600;
}

.hcgpt-user-account .membership-features {
    padding: 30px;
    border-bottom: 1px solid #e9ecef;
}

.hcgpt-user-account .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.hcgpt-user-account .feature-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.hcgpt-user-account .feature-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    flex-shrink: 0;
}

.hcgpt-user-account .feature-content h5 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 16px;
}

.hcgpt-user-account .feature-content p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.hcgpt-user-account .upgrade-section {
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.hcgpt-user-account .upgrade-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.hcgpt-user-account .upgrade-option {
    background: white;
    padding: 25px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hcgpt-user-account .upgrade-content h5 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 18px;
}

.hcgpt-user-account .upgrade-price {
    font-size: 24px;
    font-weight: 700;
    color: #007cba;
    margin-bottom: 10px;
}

.hcgpt-user-account .upgrade-highlight {
    color: #6c757d;
    margin-bottom: 20px;
    font-size: 14px;
}

.hcgpt-user-account .upgrade-benefits ul {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
    font-size: 14px;
}

.hcgpt-user-account .upgrade-benefits li {
    padding: 5px 0;
    position: relative;
    padding-left: 20px;
}

.hcgpt-user-account .upgrade-benefits li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.hcgpt-user-account .membership-actions {
    padding: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.hcgpt-user-account .action-button {
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.hcgpt-user-account .action-button.primary {
    background: #007cba;
    color: white;
}

.hcgpt-user-account .action-button.primary:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

.hcgpt-user-account .action-button.secondary {
    background: transparent;
    color: #6c757d;
    border: 1px solid #ced4da;
}

.hcgpt-user-account .action-button.secondary:hover {
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
}

.hcgpt-user-account .cancellation-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 30px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.hcgpt-user-account .notice-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.hcgpt-user-account .notice-content h5 {
    margin: 0 0 10px 0;
    color: #856404;
}

.hcgpt-user-account .notice-content p {
    margin: 0 0 15px 0;
    color: #856404;
}

.hcgpt-user-account .reactivate-button {
    background: #ffc107;
    color: #212529;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.hcgpt-user-account .reactivate-button:hover {
    background: #ffb300;
    color: #212529;
    text-decoration: none;
}

/* ========================================
   Welcome Screen Styles
   ======================================== */

.hcgpt-welcome-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.5s ease;
}

.welcome-content {
    max-width: 700px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
}

.welcome-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    color: white;
}

.welcome-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
}

.welcome-subheading {
    margin: 0;
    font-size: 18px;
    opacity: 0.9;
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 30px;
}

.feature-item {
    text-align: center;
    padding: 15px;
}

.feature-icon {
    font-size: 36px;
    margin-bottom: 15px;
}

.feature-text h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 18px;
}

.feature-text p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
}

.welcome-cta {
    padding: 20px 30px 30px;
    background: #f8f9fa;
}

.start-chatting-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.start-chatting-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.remember-choice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #6c757d;
}

.remember-choice input {
    margin: 0;
}

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

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

.hcgpt-welcome-screen.hiding {
    animation: fadeOut 0.5s ease forwards;
}

@media (max-width: 600px) {
    .welcome-features {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .welcome-header h2 {
        font-size: 24px;
    }
    
    .welcome-subheading {
        font-size: 16px;
    }
}
