/* Custom Swagger UI Styles for Quality Inspection API */

.swagger-ui .topbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 10px 20px;
    position: relative;
}

.swagger-ui .topbar .download-url-wrapper {
    display: none !important;
}

.swagger-ui .topbar .topbar-wrapper img[alt="Swagger UI"] {
    content: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 50'%3e%3ctext x='10' y='30' font-family='Arial, sans-serif' font-size='20' font-weight='bold' fill='white'%3eQuality API%3c/text%3e%3c/svg%3e");
    width: 140px;
    height: 40px;
}

/* Authentication status indicator */
.auth-status-indicator {
    position: absolute;
    top: 50%;
    right: 200px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

.auth-status-indicator.authenticated {
    background: rgba(76, 175, 80, 0.8);
}

.auth-status-indicator.unauthenticated {
    background: rgba(244, 67, 54, 0.8);
}

/* Custom button styling */
.custom-logout-btn {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: rgba(244, 67, 54, 0.9);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.custom-logout-btn:hover {
    background: rgba(244, 67, 54, 1);
}

/* Info section styling */
.swagger-ui .info {
    margin: 50px 0;
}

.swagger-ui .info .title {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.swagger-ui .info .description {
    background: #f8f9fa;
    padding: 20px;
    border-left: 4px solid #667eea;
    border-radius: 4px;
    margin: 20px 0;
}

/* Authentication section styling */
.swagger-ui .auth-wrapper {
    background: #f1f3f4;
    border: 1px solid #d4d7d9;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.swagger-ui .auth-btn-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.swagger-ui .auth-btn-wrapper .btn.authorize {
    background: #667eea;
    border-color: #667eea;
}

.swagger-ui .auth-btn-wrapper .btn.authorize:hover {
    background: #5a6fd8;
    border-color: #5a6fd8;
}

/* Operation styling */
.swagger-ui .opblock.opblock-post {
    border-color: #667eea;
}

.swagger-ui .opblock.opblock-post .opblock-summary {
    border-color: #667eea;
}

.swagger-ui .opblock.opblock-post .tab-header .tab-item.active h4 span:after {
    background: #667eea;
}

/* Responsive design */
@media (max-width: 768px) {
    .auth-status-indicator {
        position: static;
        margin: 10px 0;
        text-align: center;
    }
    
    .custom-logout-btn {
        position: static;
        margin: 10px 0;
        width: 100%;
        transform: none;
    }
    
    .swagger-ui .topbar {
        flex-direction: column;
        align-items: center;
        padding: 20px;
    }
}

/* Loading spinner */
.swagger-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Success/Error messages */
.custom-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
}

.custom-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.custom-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}