/**
 * Modern Dashboard Styles for Text to Speech Plugin
 * Enhances the existing layout with modern design elements
 */

/* General Improvements */
.wrap {
    max-width: 100%;
    margin: 0;
    padding-right: 20px;
}

/* Header Improvements */
.mementor-tts-header-layout {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    margin: 20px 0;
    max-width: 100%;
    box-sizing: border-box;
}

.mementor-tts-header-layout h1 {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0;
    font-size: 24px;
    color: #1a202c;
    font-weight: 600;
    line-height: 1;
}

.mementor-tts-header-logo {
    height: 35px;
    width: auto;
    display: block;
}

/* Navigation Improvements */
.mementor-tts-admin-nav {
    background: white;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mementor-tts-nav-left {
    display: flex;
    gap: 4px;
}

.mementor-tts-nav-item {
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mementor-tts-nav-item:hover {
    background: #f7fafc;
    color: #2d3748;
    text-decoration: none;
}

.mementor-tts-nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.mementor-tts-nav-item .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Upgrade Button */
.mementor-tts-upgrade-nav-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    padding: 10px 24px;
    margin-left: auto;
}

.mementor-tts-upgrade-nav-button:hover {
    opacity: 0.9;
    color: white !important;
}

/* New Badge */
.mementor-tts-new-feature {
    background: #ff4757;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 600;
    vertical-align: middle;
}

/* Main Content Area */
.mementor-tts-wrap {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    min-height: 600px;
}

/* Two Column Layout - Dashboard specific */
.mementor-tts-wrap.two-column {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    background: transparent;
    padding: 0;
}

.mementor-tts-wrap.two-column .mementor-tts-main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mementor-tts-wrap.two-column .mementor-tts-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Sections */
.mementor-tts-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    margin-bottom: 30px;
    overflow: hidden;
}

.mementor-tts-section-header {
    background: linear-gradient(135deg, #f7fafc 0%, #e9ecef 100%);
    padding: 20px 30px;
    border-bottom: 1px solid #e2e8f0;
}

.mementor-tts-section-header h2 {
    margin: 0;
    font-size: 20px;
    color: #1a202c;
    font-weight: 600;
}

.mementor-tts-section-content {
    padding: 30px;
}

/* Welcome Section - Audio Player */
.mementor-tts-player {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 12px;
    margin: 20px 0;
}

.mementor-tts-custom-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.mementor-tts-play-button {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mementor-tts-play-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.mementor-tts-play-button .dashicons {
    font-size: 24px;
    color: white;
}

.mementor-tts-progress-container {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.mementor-tts-progress-bar {
    height: 100%;
    background: white;
    border-radius: 3px;
    width: 0;
    transition: width 0.1s;
}

.mementor-tts-time-display,
.mementor-tts-duration-display {
    min-width: 45px;
    font-size: 14px;
    font-weight: 500;
}

.mementor-tts-volume-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
}

/* Form Improvements */
.form-table th {
    font-weight: 600;
    color: #2d3748;
}

.mementor-tts-input {
    width: 100%;
    max-width: 400px;
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.mementor-tts-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* API Status */
.mementor-tts-api-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-left: 15px;
}

.mementor-tts-api-status.connected {
    background: #d4f1d4;
    color: #1e7e34;
}

.mementor-tts-api-status.not-connected {
    background: #f8d7da;
    color: #721c24;
}

.mementor-tts-api-status .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Service Name Link */
.mementor-tts-service-name a {
    color: #667eea;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mementor-tts-service-name a:hover {
    color: #5a67d8;
}

/* External Link Icon */
.mementor-tts-external-link::after {
    content: "↗";
    margin-left: 4px;
    font-size: 12px;
}

/* Get Started Box */
.mementor-tts-get-started {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
}

.mementor-tts-get-started h3 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 18px;
}

.mementor-tts-get-started ol {
    margin: 0 0 20px 20px;
    padding: 0;
}

.mementor-tts-get-started li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Pro Option Box */
.mementor-tts-pro-option {
    background: linear-gradient(135deg, #f7fafc 0%, #e9ecef 100%);
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

/* Buttons */
.button {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    text-shadow: none;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.button-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46a1 100%);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.button-secondary {
    background: white;
    border: 2px solid #e2e8f0;
    color: #4a5568;
}

.button-secondary:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #2d3748;
}

/* Reset API Settings Link */
.mementor-tts-reset-api-key {
    color: #e53e3e;
    margin-left: 15px;
}

.mementor-tts-reset-api-key:hover {
    color: #c53030;
}

/* Storage Section */
.mementor-tts-select {
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    min-width: 300px;
}

.mementor-tts-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Helper Text */
.mementor-tts-helper-text {
    color: #718096;
    font-size: 14px;
    line-height: 1.6;
    margin-top: 10px;
}

/* Tooltip */
.tooltip-icon {
    color: #667eea;
    cursor: help;
    position: relative;
}

.tooltip-text {
    display: none;
    position: absolute;
    background: #2d3748;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 1000;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 5px;
}

.tooltip-icon:hover .tooltip-text {
    display: block;
}

/* Save Settings Container */
.save-settings-container {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
}

/* Dropbox Info */
#mementor-tts-dropbox-info {
    margin-top: 15px;
}

#mementor-tts-dropbox-info .mementor-tts-helper-text > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Radio Buttons */
input[type="radio"] {
    margin-right: 8px;
}

label {
    display: inline-flex;
    align-items: center;
    margin-right: 20px;
}

/* Disabled Options */
.mementor-tts-pro-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 8px;
    font-weight: 600;
}

/* Sidebar Improvements */
.mementor-tts-sidebar-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Quick Stats Card */
.mementor-tts-stats-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.mementor-tts-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.mementor-tts-stat-item {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.mementor-tts-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
    line-height: 1;
}

.mementor-tts-stat-label {
    font-size: 13px;
    color: #718096;
    margin-top: 8px;
}

.mementor-tts-sidebar-box h3 {
    color: white;
    margin: 0 0 15px 0;
    font-size: 24px;
}

.mementor-tts-sidebar-box p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin: 0 0 20px 0;
}

.mementor-tts-sidebar-box .button {
    background: white;
    color: #667eea;
    border: none;
    font-weight: 600;
    padding: 12px 30px;
    font-size: 16px;
}

.mementor-tts-sidebar-box .button:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #5a67d8;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .mementor-tts-wrap.two-column {
        grid-template-columns: 1fr;
    }
    
    .mementor-tts-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 782px) {
    .mementor-tts-admin-nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .mementor-tts-nav-left {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .mementor-tts-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .wrap {
        padding-right: 10px;
    }
    
    .mementor-tts-header-layout {
        padding: 15px 20px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mementor-tts-section {
    animation: fadeIn 0.3s ease-out;
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Loading State */
.mementor-tts-loading {
    opacity: 0.6;
    pointer-events: none;
}

.mementor-tts-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}