/* Dashboard New System - Separate Pages */

/* Dashboard Wrapper - Full Screen */
.dashboard-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--background);
    z-index: 2000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-wrapper.active {
    display: flex !important;
}

/* Close Button */
.dashboard-close-btn {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
}

.dashboard-close-btn:hover {
    transform: scale(1.1) rotate(90deg);
    background: #dc2626;
}

/* Dashboard Navigation */
.dashboard-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.dashboard-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.dashboard-logo i {
    color: var(--primary-color);
}

.dashboard-tabs {
    display: flex;
    gap: 0.5rem;
}

.dashboard-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.dashboard-tab:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.dashboard-tab.active {
    background: var(--primary-color);
    color: white;
}

.dashboard-tab i {
    font-size: 1.125rem;
}

.dashboard-user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.dashboard-user-info i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Dashboard Content */
.dashboard-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Dashboard Pages */
.dashboard-page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.dashboard-page.active {
    display: block;
}

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

/* Page Header */
.page-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.page-header h1 i {
    color: var(--primary-color);
}

.page-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.content-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s ease;
}

.content-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.content-card.full-width {
    grid-column: 1 / -1;
}

.content-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.content-card h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 1rem;
    color: var(--text-primary);
}

/* Profile Page Styles */
.info-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.info-row label {
    font-weight: 500;
    color: var(--text-secondary);
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
}

.info-value.mono {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-box {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.action-btn i {
    font-size: 1.25rem;
}

/* Language Grid */
.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.language-card {
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.language-card:hover:not(.disabled) {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.language-card.active {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.language-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.coming-soon-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--warning);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.language-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.language-flag {
    width: 40px;
    height: 30px;
    border-radius: 4px;
    flex-shrink: 0;
}

.de-flag {
    background: linear-gradient(to bottom, #000 33%, #dd0000 33%, #dd0000 66%, #ffce00 66%);
}

.en-flag {
    background: linear-gradient(to bottom, #012169 50%, #fff 50%);
}

.es-flag {
    background: linear-gradient(to bottom, #aa151b 33%, #f1bf00 33%, #f1bf00 66%, #aa151b 66%);
}

.fr-flag {
    background: linear-gradient(to right, #002654 33%, #fff 33%, #fff 66%, #ed2939 66%);
}

.language-info h3 {
    margin: 0;
    font-size: 1.25rem;
}

.language-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

.language-status.available {
    background: var(--success);
    color: white;
}

.language-status.coming {
    background: var(--warning);
    color: white;
}

.language-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

/* API Key Section */
.api-key-section {
    margin: 1.5rem 0;
}

.api-key-section label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.api-key-display {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.api-key-input {
    flex: 1;
    padding: 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.copy-btn {
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.api-key-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* Limits Section */
.limits-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.limit-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.limit-box {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.limit-icon {
    width: 3rem;
    height: 3rem;
    background: var(--gradient-primary);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.limit-content {
    flex: 1;
}

.limit-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.limit-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* API Docs Section */
.api-docs-section {
    margin: 2rem 0;
}

.code-block {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.code-block code {
    color: var(--text-primary);
}

/* Usage Page Styles */
.usage-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.usage-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.usage-stat-icon {
    font-size: 2rem;
}

.usage-stat-content {
    flex: 1;
}

.usage-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.usage-stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Usage Progress */
.usage-progress {
    margin-top: 2rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.progress-bar {
    height: 12px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 6px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-note {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* Month Stats */
.month-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.month-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.month-stat-row.highlight {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.month-stat-row strong {
    color: var(--text-primary);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.activity-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--surface-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-content p {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.activity-content small {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* API Tester */
.api-tester {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.tester-input label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.tester-input textarea {
    width: 100%;
    padding: 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-family: inherit;
    resize: vertical;
    margin-bottom: 1rem;
}

.tester-input textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.tester-controls {
    display: flex;
    gap: 1rem;
}

.tester-controls select {
    flex: 1;
    padding: 0.75rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text-primary);
}

.tester-output {
    padding: 1.5rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.tester-output h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.tester-result {
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}

.tester-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.tester-meta .success {
    color: var(--success);
}

.tester-meta .error {
    color: var(--error);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-overlay.hidden {
    display: none;
}

.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: var(--surface);
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .api-tester {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .dashboard-tabs {
        width: 100%;
        overflow-x: auto;
    }
    
    .dashboard-tab {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
        flex-direction: column;
    }
    
    .stats-grid,
    .usage-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .language-grid {
        grid-template-columns: 1fr;
    }
    
    .api-key-actions {
        flex-direction: column;
    }
    
    .dashboard-close-btn {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}
