/**
 * PGTRB Voice Tutor Plugin - Modern UI Styles
 */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-light: 0 8px 32px rgba(31, 38, 135, 0.37);
    --shadow-heavy: 0 20px 40px rgba(0, 0, 0, 0.15);
    --border-radius: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.pgtrb-voice-tutor-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: var(--border-radius);
    padding: 30px;
    margin: 20px 0;
    box-shadow: var(--shadow-heavy);
    color: white;
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.pgtrb-voice-tutor-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
    z-index: 1;
}

.pgtrb-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.pgtrb-header h3 {
    margin: 0 0 15px 0;
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #ffffff 0%, #a8edea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.pgtrb-description {
    margin: 0;
    opacity: 0.95;
    font-size: 18px;
    line-height: 1.6;
    font-weight: 400;
    color: rgba(255,255,255,0.9);
}

.pgtrb-badge {
    display: inline-block;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    margin: 10px 5px 0 5px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.pgtrb-badge:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.pgtrb-input-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.pgtrb-input-section:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
}

.pgtrb-text-input {
    margin-bottom: 15px;
}

#pgtrb-query-input {
    width: 100%;
    min-height: 100px;
    padding: 20px;
    border: 2px solid transparent;
    border-radius: 16px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    color: #2d3748;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
    resize: vertical;
    transition: var(--transition);
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    font-family: inherit;
}

#pgtrb-query-input:focus {
    outline: none;
    border: 2px solid transparent;
    background: rgba(255,255,255,0.98);
    box-shadow: 0 8px 40px rgba(0,0,0,0.15), 0 0 0 4px rgba(79,172,254,0.2);
    transform: translateY(-1px) scale(1.01);
}

#pgtrb-query-input::placeholder {
    color: #a0aec0;
    font-weight: 400;
    font-style: normal;
}

.pgtrb-voice-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.pgtrb-record-button {
    background: var(--secondary-gradient);
    color: white;
    border: none;
    padding: 16px 28px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 25px rgba(245,87,108,0.3);
    min-width: 180px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.pgtrb-record-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.pgtrb-record-button:hover::before {
    left: 100%;
}

.pgtrb-record-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(245,87,108,0.4);
}

.pgtrb-record-button.recording {
    background: linear-gradient(135deg, #ff4757, #ff3742);
    animation: recordingPulse 2s infinite;
    box-shadow: 0 0 30px rgba(255,71,87,0.6);
}

.pgtrb-record-button.ready {
    background: var(--success-gradient);
    box-shadow: 0 8px 25px rgba(56,239,125,0.3);
}

@keyframes recordingPulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 30px rgba(255,71,87,0.6);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 40px rgba(255,71,87,0.8);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 30px rgba(255,71,87,0.6);
    }
}

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

/* Micro-interactions */
.pgtrb-bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) translateY(-10px);
    }
    70% {
        transform: scale(0.9) translateY(0px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Status indicators with modern styling */
.pgtrb-status {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.pgtrb-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.pgtrb-status.recording::before {
    animation: statusPulse 1s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.pgtrb-status {
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    min-height: 20px;
    display: flex;
    align-items: center;
    flex: 1;
}

.pgtrb-status.recording {
    background: rgba(231,76,60,0.3);
    color: #fff;
    animation: blink 1s infinite;
}

.pgtrb-status.processing {
    background: rgba(52,152,219,0.3);
    color: #fff;
}

.pgtrb-status.success {
    background: rgba(46,204,113,0.3);
    color: #fff;
}

.pgtrb-status.error {
    background: rgba(231,76,60,0.3);
    color: #fff;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

/* Modern utility classes */
.pgtrb-gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pgtrb-shadow-lg {
    box-shadow: var(--shadow-heavy);
}

.pgtrb-transition {
    transition: var(--transition);
}

/* Improved focus states for accessibility */
.pgtrb-focusable:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Performance optimizations */
.pgtrb-voice-tutor-container * {
    will-change: transform;
}

.pgtrb-gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
}

/* Modern UI Animations */
@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-20px) rotate(90deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-10px) rotate(180deg);
        opacity: 0.5;
    }
    75% {
        transform: translateY(-30px) rotate(270deg);
        opacity: 0.8;
    }
}

.pgtrb-particle {
    pointer-events: none;
    z-index: 0;
}

/* Recording active state */
.recording-active {
    animation: recordingGlow 2s ease-in-out infinite alternate;
}

@keyframes recordingGlow {
    from {
        box-shadow: var(--shadow-heavy), 0 0 20px rgba(255,71,87,0.3);
    }
    to {
        box-shadow: var(--shadow-heavy), 0 0 40px rgba(255,71,87,0.6);
    }
}

/* Input focus and typing states */
.pgtrb-input-section.focused {
    background: rgba(255,255,255,0.2);
    border-color: rgba(79,172,254,0.5);
    box-shadow: 0 0 30px rgba(79,172,254,0.2);
}

#pgtrb-query-input.typing {
    border-left: 4px solid #667eea;
    animation: typingPulse 1s infinite;
}

@keyframes typingPulse {
    0%, 100% { border-left-color: #667eea; }
    50% { border-left-color: #764ba2; }
}

#pgtrb-query-input.highlight {
    animation: highlightInput 1s ease-in-out;
}

@keyframes highlightInput {
    0%, 100% { background: rgba(255,255,255,0.95); }
    50% { background: rgba(79,172,254,0.1); }
}

/* Notification styles */
.pgtrb-notification {
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-icon {
    font-size: 16px;
}

.notification-text {
    font-weight: 600;
    font-size: 14px;
}

/* Tooltip styles */
.pgtrb-tooltip {
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
    font-weight: 500 !important;
    letter-spacing: 0.5px !important;
}

/* Share modal styles */
.pgtrb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

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

.pgtrb-share-menu {
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.9));
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    padding: 25px;
    min-width: 300px;
    text-align: center;
    box-shadow: var(--shadow-heavy);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pgtrb-share-menu h4 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 18px;
    font-weight: 700;
}

.pgtrb-share-option {
    display: block;
    padding: 12px 20px;
    margin: 8px 0;
    background: var(--accent-gradient);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: var(--transition);
}

.pgtrb-share-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79,172,254,0.3);
    text-decoration: none;
    color: white;
}

/* Loading container state */
.pgtrb-voice-tutor-container.loading {
    opacity: 0.9;
    pointer-events: none;
}

.pgtrb-voice-tutor-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.1);
    z-index: 10;
    border-radius: inherit;
}

/* Action button icons */
.action-icon {
    display: inline-block;
    margin-right: 6px;
    transition: var(--transition);
}

.pgtrb-action-btn:hover .action-icon {
    transform: scale(1.1);
}

/* Status indicator */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    background: currentColor;
}

.status-indicator.recording {
    animation: recordingIndicator 1s infinite;
}

@keyframes recordingIndicator {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(0.8);
    }
}

/* Enhanced button states */
.pgtrb-record-button:active {
    transform: scale(0.95);
}

.pgtrb-submit-button:active {
    transform: translateY(-2px) scale(0.98);
}

/* Smooth scrollbar for better UX */
.pgtrb-response-section {
    scrollbar-width: thin;
    scrollbar-color: rgba(102,126,234,0.5) transparent;
}

/* Loading state enhancements */
.pgtrb-voice-tutor-container.loading .pgtrb-submit-button {
    background: linear-gradient(135deg, #a0aec0, #718096);
    cursor: wait;
}

/* Improved accessibility focus states */
.pgtrb-focusable:focus-visible {
    outline: 3px solid rgba(79,172,254,0.5);
    outline-offset: 2px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .pgtrb-voice-tutor-container,
    .pgtrb-bounce-in,
    .pgtrb-floating,
    .pgtrb-loading-dot,
    .pgtrb-particle,
    .recording-active {
        animation: none !important;
    }
    
    .pgtrb-transition,
    * {
        transition: none !important;
    }
}

/* New Modern UI Elements */
.pgtrb-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.pgtrb-input-hint {
    text-align: center;
    margin-top: 8px;
    opacity: 0.7;
}

.pgtrb-input-hint small {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
}

.record-icon, .submit-icon {
    display: inline-block;
    margin-right: 8px;
    font-size: 1.2em;
    transition: var(--transition);
}

.record-pulse, .button-shine {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.pgtrb-record-button.recording .record-pulse {
    opacity: 1;
    animation: recordingRipple 2s infinite;
}

@keyframes recordingRipple {
    0% {
        box-shadow: 0 0 0 0 rgba(255,71,87,0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(255,71,87,0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255,71,87,0);
    }
}

.pgtrb-submit-button:hover .button-shine {
    opacity: 0.3;
    animation: buttonShine 1.5s ease-in-out infinite;
}

@keyframes buttonShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.pgtrb-quick-start {
    margin-top: 25px;
    text-align: left;
    background: rgba(102,126,234,0.1);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

.pgtrb-quick-start h5 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-weight: 700;
    font-size: 16px;
}

.pgtrb-steps {
    margin: 0;
    padding-left: 20px;
    color: #4a5568;
}

.pgtrb-steps li {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.pgtrb-footer {
    margin-top: 20px;
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.pgtrb-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.pgtrb-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 120px;
    padding: 10px;
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.pgtrb-submit-section {
    text-align: center;
}

/* Enhanced button states for new elements */
.pgtrb-record-button:hover .record-icon {
    transform: scale(1.1) rotate(5deg);
}

.pgtrb-submit-button:hover .submit-icon {
    transform: scale(1.1);
}

/* Dark mode enhancements for new elements */
@media (prefers-color-scheme: dark) {
    .pgtrb-input-hint small {
        color: rgba(255,255,255,0.6);
    }
    
    .pgtrb-quick-start {
        background: rgba(102,126,234,0.05);
        border-left-color: #667eea;
    }
    
    .pgtrb-quick-start h5 {
        color: #e2e8f0;
    }
    
    .pgtrb-steps {
        color: #cbd5e0;
    }
    
    .pgtrb-footer {
        background: rgba(0,0,0,0.2);
        border-top-color: rgba(255,255,255,0.1);
    }
}

/* Mobile responsive updates for new elements */
@media (max-width: 768px) {
    .pgtrb-badges {
        flex-direction: column;
        align-items: center;
    }
    
    .pgtrb-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .pgtrb-stat {
        min-width: auto;
        width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 15px;
    }
    
    .stat-icon {
        font-size: 20px;
        margin-bottom: 0;
    }
    
    .pgtrb-quick-start {
        text-align: center;
    }
    
    .pgtrb-steps {
        text-align: left;
        padding-left: 20px;
    }
}

.pgtrb-submit-button {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 18px 36px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 30px rgba(79,172,254,0.3);
    min-width: 220px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pgtrb-submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}

.pgtrb-submit-button:hover:not(:disabled)::before {
    left: 100%;
}

.pgtrb-submit-button:hover:not(:disabled) {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 40px rgba(79,172,254,0.4);
}

.pgtrb-submit-button:active {
    transform: translateY(-2px) scale(1.02);
}

.pgtrb-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(79,172,254,0.2);
}

.pgtrb-response-section {
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    color: #2d3748;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 25px;
    min-height: 250px;
    max-height: 600px;
    overflow-y: auto;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    position: relative;
}

.pgtrb-response-section::-webkit-scrollbar {
    width: 8px;
}

.pgtrb-response-section::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
}

.pgtrb-response-section::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}

.pgtrb-response-section::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

.pgtrb-welcome {
    text-align: center;
    color: #4a5568;
    padding: 20px 0;
}

.pgtrb-welcome h4 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pgtrb-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.pgtrb-feature-card {
    background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.1));
    border: 1px solid rgba(102,126,234,0.2);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.pgtrb-feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(102,126,234,0.2);
    background: linear-gradient(135deg, rgba(102,126,234,0.15), rgba(118,75,162,0.15));
}

.pgtrb-feature-icon {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
}

.pgtrb-feature-title {
    font-weight: 700;
    font-size: 16px;
    color: #2d3748;
    margin-bottom: 8px;
}

.pgtrb-feature-desc {
    font-size: 14px;
    color: #718096;
    line-height: 1.4;
}

.pgtrb-loading {
    text-align: center;
    padding: 50px 20px;
    font-size: 20px;
    color: #667eea;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.pgtrb-loading-dots {
    display: flex;
    gap: 8px;
}

.pgtrb-loading-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    animation: loadingBounce 1.4s infinite both;
}

.pgtrb-loading-dot:nth-child(1) { animation-delay: -0.32s; }
.pgtrb-loading-dot:nth-child(2) { animation-delay: -0.16s; }
.pgtrb-loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes loadingBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.pgtrb-thinking-text {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: thinkingGlow 2s ease-in-out infinite alternate;
}

@keyframes thinkingGlow {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

.pgtrb-response-content {
    animation: slideInUp 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

@keyframes slideInUp {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.pgtrb-response-header {
    border-bottom: 2px solid #3498db;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.pgtrb-response-header h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 20px;
}

.pgtrb-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #7f8c8d;
    flex-wrap: wrap;
}

.pgtrb-meta span {
    background: #ecf0f1;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.pgtrb-response-text {
    line-height: 1.7;
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 20px;
}

.pgtrb-response-text p {
    margin-bottom: 15px;
}

.pgtrb-response-text strong {
    color: #2980b9;
    font-weight: 600;
}

.pgtrb-section-title {
    display: block;
    color: #e74c3c;
    font-size: 18px;
    margin: 20px 0 10px 0;
    border-left: 4px solid #e74c3c;
    padding-left: 10px;
}

.pgtrb-emoji {
    font-size: 1.2em;
    margin-right: 5px;
}

.pgtrb-actions {
    display: flex;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.08);
    flex-wrap: wrap;
    justify-content: center;
}

.pgtrb-action-btn {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #495057;
    border: 1px solid rgba(0,0,0,0.1);
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.pgtrb-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.pgtrb-action-btn:hover::before {
    left: 100%;
}

.pgtrb-action-btn:hover {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.pgtrb-action-btn.success {
    background: var(--success-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(56,239,125,0.3);
}

.pgtrb-action-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(79,172,254,0.3);
}

.pgtrb-error {
    text-align: center;
    padding: 30px;
    color: #e74c3c;
}

.pgtrb-error h4 {
    margin-bottom: 15px;
    font-size: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pgtrb-voice-tutor-container {
        margin: 15px;
        padding: 25px;
        border-radius: 16px;
    }
    
    .pgtrb-header h3 {
        font-size: 28px;
    }
    
    .pgtrb-badge {
        display: block;
        margin: 8px auto;
        width: fit-content;
    }
    
    .pgtrb-voice-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .pgtrb-record-button,
    .pgtrb-submit-button {
        width: 100%;
        margin-bottom: 0;
        padding: 16px;
        font-size: 16px;
    }
    
    .pgtrb-feature-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .pgtrb-meta {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .pgtrb-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pgtrb-action-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    #pgtrb-query-input {
        font-size: 16px;
        padding: 16px;
    }
}

/* Enhanced Dark Mode */
@media (prefers-color-scheme: dark) {
    .pgtrb-voice-tutor-container {
        background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
        border-color: rgba(255,255,255,0.1);
    }
    
    .pgtrb-response-section {
        background: rgba(26,32,44,0.95);
        color: #e2e8f0;
        border-color: rgba(255,255,255,0.1);
    }
    
    .pgtrb-welcome {
        color: #a0aec0;
    }
    
    .pgtrb-welcome h4 {
        color: #e2e8f0;
        background: linear-gradient(135deg, #667eea, #764ba2);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
    
    .pgtrb-feature-card {
        background: rgba(102,126,234,0.05);
        border-color: rgba(102,126,234,0.1);
    }
    
    .pgtrb-feature-card:hover {
        background: rgba(102,126,234,0.1);
    }
    
    .pgtrb-feature-title {
        color: #e2e8f0;
    }
    
    .pgtrb-response-text {
        color: #e2e8f0;
    }
    
    .pgtrb-meta span {
        background: rgba(45,55,72,0.8);
        color: #cbd5e0;
    }
    
    .pgtrb-action-btn {
        background: linear-gradient(135deg, #2d3748, #4a5568);
        color: #e2e8f0;
        border-color: rgba(255,255,255,0.1);
    }
    
    .pgtrb-action-btn:hover {
        background: linear-gradient(135deg, #4a5568, #2d3748);
    }
    
    #pgtrb-query-input {
        background: rgba(26,32,44,0.9);
        color: #e2e8f0;
        border-color: rgba(255,255,255,0.1);
    }
    
    #pgtrb-query-input:focus {
        background: rgba(26,32,44,0.95);
        box-shadow: 0 8px 40px rgba(0,0,0,0.3), 0 0 0 4px rgba(79,172,254,0.3);
    }
    
    #pgtrb-query-input::placeholder {
        color: #718096;
    }
}

/* Glass morphism effects */
.pgtrb-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

/* Floating animation */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(1deg); }
    66% { transform: translateY(-5px) rotate(-1deg); }
}

.pgtrb-floating {
    animation: float 6s ease-in-out infinite;
}

/* Glow effects */
.pgtrb-glow {
    position: relative;
}

.pgtrb-glow::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #667eea, #764ba2, #667eea);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.pgtrb-glow:hover::after {
    opacity: 0.3;
    animation: glowRotate 2s linear infinite;
}

@keyframes glowRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}