/* Dashboard-specific styles */

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

.dashboard-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Loading and Error States */
.loading-state, .error-state {
    text-align: center;
    padding: 4rem 2rem;
    color: white;
}

.loading-state p {
    color: white;
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.error-state {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.retry-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.retry-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Dashboard Sections */
.dashboard-section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: none;
    animation: fadeIn 0.5s ease-in;
}

.dashboard-section h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Usage Cards */
.usage-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.usage-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.usage-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.usage-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.usage-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.usage-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.usage-percentage {
    font-size: 1.5rem;
    font-weight: bold;
}

.plan-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.activity-count {
    font-size: 2rem;
    font-weight: bold;
}

.usage-progress {
    background: rgba(255, 255, 255, 0.2);
    height: 8px;
    border-radius: 4px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.usage-progress-bar {
    background: white;
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.usage-stats {
    font-size: 1.1rem;
    font-weight: 500;
}

.plan-details p, .activity-details p {
    margin: 0.5rem 0;
    opacity: 0.9;
}

.activity-status {
    font-weight: 600;
}

/* API Key Management */
.api-key-section {
    max-width: 600px;
}

.api-key-display {
    margin-bottom: 1.5rem;
}

.api-key-display label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.api-key-input-group {
    display: flex;
    gap: 0.5rem;
}

.api-key-input-group input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: #f8f9fa;
}

.toggle-btn, .copy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
}

.toggle-btn:hover, .copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.regenerate-btn {
    background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
    backdrop-filter: blur(10px);
}

.regenerate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
}

.api-key-warning {
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Analytics */
.analytics-section {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

.chart-container {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    height: 400px;
    max-width: 100%;
}

.chart-container canvas {
    max-height: 300px !important;
}

.chart-container h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
}

.analytics-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    text-align: center;
}

.stat-label {
    display: block;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    color: #333;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Usage History Table */
.history-table-container {
    overflow-x: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.history-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e9ecef;
}

.history-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.history-table tr:hover {
    background: #f8f9fa;
}

.status-success {
    color: #28a745;
    font-weight: 600;
}

.status-error {
    color: #dc3545;
    font-weight: 600;
}

/* API Documentation */
.api-docs {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.api-endpoint h3 {
    color: #333;
    margin-bottom: 1rem;
}

.endpoint-details > div {
    margin-bottom: 1.5rem;
}

.endpoint-url {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.method {
    background: #28a745;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
}

.endpoint-url code {
    background: white;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.endpoint-example h4, .endpoint-headers h4 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.endpoint-example pre, .endpoint-headers pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
}

.endpoint-example code, .endpoint-headers code {
    background: none;
    color: inherit;
    padding: 0;
    border: none;
}

.warning-text {
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 0.75rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.confirm-btn {
    background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
    backdrop-filter: blur(10px);
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
}

.cancel-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
}

.cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }
    
    .usage-cards {
        grid-template-columns: 1fr;
    }
    
    .analytics-section {
        grid-template-columns: 1fr;
    }
    
    .api-key-input-group {
        flex-direction: column;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .endpoint-url {
        flex-direction: column;
        align-items: stretch;
    }
}
