/* User Panel - Professional Design */
.api-user-panel {
    direction: rtl;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 40px 20px;
    border-radius: 20px;
    min-height: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.user-header {
    text-align: center;
    padding: 50px 20px;
    background: linear-gradient(135deg, #c62828 0%, #8e0000 100%);
    border-radius: 16px;
    margin-bottom: 35px;
    box-shadow: 0 6px 25px rgba(198, 40, 40, 0.35);
    position: relative;
    overflow: hidden;
}

.user-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.user-header h1 {
    margin: 0;
    font-size: 32px;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

/* Login Notice */
.login-notice {
    background: linear-gradient(135deg, #2c2c2c 0%, #1f1f1f 100%);
    padding: 50px 35px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 35px;
    border: 2px solid #c62828;
}

.login-notice p {
    margin: 0 0 25px 0;
    font-size: 17px;
    color: #d0d0d0;
    line-height: 1.8;
}

.btn-login {
    display: inline-block;
    background: linear-gradient(135deg, #c62828 0%, #8e0000 100%);
    color: white !important;
    padding: 16px 50px;
    border-radius: 10px;
    text-decoration: none !important;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(198, 40, 40, 0.4);
    transition: all 0.3s ease;
}

.btn-login:hover {
    box-shadow: 0 8px 30px rgba(198, 40, 40, 0.6);
    opacity: 0.95;
    color: white !important;
    text-decoration: none !important;
}

/* Blocked Notice */
.blocked-notice {
    background: linear-gradient(135deg, #2c2c2c 0%, #1f1f1f 100%);
    padding: 50px 35px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 35px;
    border: 2px solid #c62828;
}

.blocked-notice p {
    margin: 0 0 15px 0;
    font-size: 17px;
    color: #d0d0d0;
    line-height: 1.8;
}

.blocked-label {
    background: #c62828;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}

/* API Key Section */
.api-key-section {
    background: linear-gradient(135deg, #2c2c2c 0%, #1f1f1f 100%);
    padding: 35px;
    border-radius: 16px;
    margin-bottom: 35px;
    border: 2px solid #333;
}

.key-box label {
    display: block;
    margin-bottom: 15px;
    font-size: 16px;
    color: #d0d0d0;
    font-weight: 600;
}

.key-display {
    display: flex;
    gap: 15px;
    align-items: stretch;
    margin-bottom: 20px;
}

.key-display code {
    flex: 1;
    background: #1a1a1a;
    color: #ff6b6b;
    padding: 18px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    border: 2px solid #333;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
}

.key-actions {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.btn-copy {
    background: linear-gradient(135deg, #c62828 0%, #8e0000 100%);
    color: white !important;
    border: none;
    padding: 18px 32px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    white-space: nowrap;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(198, 40, 40, 0.3);
    transition: all 0.3s ease;
}

.btn-copy:hover {
    opacity: 0.9;
    box-shadow: 0 6px 20px rgba(198, 40, 40, 0.5);
    color: white !important;
}

.btn-regenerate {
    background: #333;
    color: white !important;
    border: none;
    padding: 18px 32px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.btn-regenerate:hover {
    background: #444;
    color: white !important;
}

/* APIs Section */
.apis-section {
    text-align: center;
    margin-top: 35px;
}

.btn-apis-list {
    background: linear-gradient(135deg, #c62828 0%, #8e0000 100%);
    color: white !important;
    border: none;
    padding: 18px 60px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
    box-shadow: 0 6px 25px rgba(198, 40, 40, 0.4);
    transition: all 0.3s ease;
}

.btn-apis-list:hover {
    box-shadow: 0 8px 30px rgba(198, 40, 40, 0.6);
    opacity: 0.95;
    color: white !important;
}

/* APIs Grid */
.apis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
    margin-top: 35px;
    padding: 25px 0;
}

.api-card {
    background: linear-gradient(135deg, #2c2c2c 0%, #1f1f1f 100%);
    border: 2px solid #333;
    border-radius: 16px;
    padding: 28px;
    text-align: center;
}

.api-card:hover {
    border-color: #c62828;
    box-shadow: 0 10px 30px rgba(198, 40, 40, 0.25);
}

.api-image {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a1a;
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.api-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.api-card h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: #ffffff;
    font-weight: 700;
}

.api-stats {
    margin-bottom: 18px;
    font-size: 14px;
    color: #999;
    padding: 10px;
    background: #1a1a1a;
    border-radius: 8px;
}

.btn-details, .btn-login-card {
    background: linear-gradient(135deg, #c62828 0%, #8e0000 100%);
    color: white !important;
    border: none;
    padding: 14px 35px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    width: 100%;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(198, 40, 40, 0.3);
    text-decoration: none !important;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-details:hover, .btn-login-card:hover {
    opacity: 0.9;
    box-shadow: 0 6px 20px rgba(198, 40, 40, 0.5);
    color: white !important;
    text-decoration: none !important;
}

.btn-details:visited, .btn-login-card:visited,
.btn-details:focus, .btn-login-card:focus,
.btn-details:active, .btn-login-card:active {
    color: white !important;
    text-decoration: none !important;
}

/* API Status Indicator */
.api-status-indicator {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    z-index: 2;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.status-active {
    background: #4caf50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
}

.status-dot.status-inactive {
    background: #f44336;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.6);
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.status-text {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.api-card {
    position: relative;
}

.api-card.api-disabled {
    opacity: 0.7;
}

.api-card.api-disabled .api-image {
    filter: grayscale(100%);
}

.btn-disabled {
    background: #555 !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

.btn-disabled:hover {
    box-shadow: none !important;
}

/* API Detail Page Styles */
.api-detail-page {
    background: transparent;
    color: #e0e0e0;
    padding: 0;
    min-height: auto;
}

.api-detail-container {
    max-width: 900px;
    margin: 0 auto;
    background: linear-gradient(135deg, #2c2c2c 0%, #1f1f1f 100%);
    border-radius: 20px;
    padding: 45px;
    border: 2px solid #333;
}

.api-detail-header {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 2px solid #333;
}

.api-detail-logo {
    width: 90px;
    height: 90px;
    border-radius: 14px;
    overflow: hidden;
    background: #1a1a1a;
    border: 2px solid #333;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.api-detail-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.api-detail-title h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: #ffffff;
    font-weight: 700;
}

.api-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.api-inactive-notice {
    background: rgba(244, 67, 54, 0.15);
    border: 2px solid #f44336;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
}

.api-inactive-notice p {
    margin: 0;
    color: #ff6b6b;
    font-size: 16px;
    font-weight: 600;
}

.api-detail-section {
    margin-bottom: 30px;
}

.api-detail-section h2 {
    color: #ff6b6b;
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
}

.api-detail-section p {
    line-height: 1.9;
    color: #d0d0d0;
    font-size: 16px;
}

.api-detail-section pre {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    border: 2px solid #333;
    margin: 15px 0;
}

.api-detail-section code {
    color: #ff6b6b;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    line-height: 1.6;
    direction: ltr;
    text-align: left;
    display: block;
}

.btn-back {
    background: #333;
    color: white !important;
    border: none;
    padding: 14px 35px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    margin-top: 25px;
    text-decoration: none !important;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: linear-gradient(135deg, #c62828 0%, #8e0000 100%);
    box-shadow: 0 6px 20px rgba(198, 40, 40, 0.5);
    transform: translateY(-2px);
    color: white !important;
    text-decoration: none !important;
}

.btn-back:visited,
.btn-back:focus,
.btn-back:active {
    color: white !important;
    text-decoration: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .api-user-panel {
        padding: 25px 15px;
    }
    
    .user-header {
        padding: 40px 20px;
    }
    
    .user-header h1 {
        font-size: 26px;
    }
    
    .api-key-section {
        display: block;
    }
    
    .key-box label {
        margin-bottom: 15px;
    }
    
    .key-display {
        flex-direction: column;
        margin-bottom: 20px;
    }
    
    .key-actions {
        flex-direction: column;
    }
    
    .btn-copy, .btn-regenerate {
        width: 100%;
    }
    
    .apis-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }
    
    .login-notice {
        padding: 35px 25px;
    }
    
    .api-detail-container {
        padding: 30px 20px;
    }
    
    .api-detail-header {
        flex-direction: column;
        text-align: center;
    }
}

/* Desktop Layout - همه چیز در یک خط */
@media (min-width: 769px) {
    .api-key-section {
        display: flex;
        align-items: center;
        gap: 20px;
        flex-wrap: nowrap;
    }
    
    .key-box {
        display: flex;
        align-items: center;
        gap: 20px;
        flex: 1;
        min-width: 0;
        margin-bottom: 0;
    }
    
    .key-box label {
        margin: 0;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .key-display {
        flex: 1;
        margin-bottom: 0;
    }
    
    .key-display code {
        width: 100%;
    }
    
    .key-actions {
        flex-direction: row;
        flex-shrink: 0;
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .user-header h1 {
        font-size: 24px;
    }
    
    .api-key-section {
        padding: 25px;
    }
    
    .key-display code {
        font-size: 14px;
        padding: 16px;
        letter-spacing: 1px;
    }
    
    .btn-apis-list {
        padding: 16px 40px;
        font-size: 16px;
    }
    
    .api-detail-logo {
        width: 70px;
        height: 70px;
    }
    
    .api-detail-title h1 {
        font-size: 24px;
    }
}