/* Custom Swagger UI styling for Asset Management Portal */

/* Import modern typography */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

body, 
.swagger-section, 
.swagger-section *, 
#resources_container *, 
.swagger-section .swagger-ui-wrap, 
.swagger-section .swagger-ui-wrap * {
    font-family: 'Outfit', 'Segoe UI', Arial, sans-serif !important;
}

body {
    background-color: #f8fafc !important;
    color: #334155 !important;
}

/* Header customization - Modern Slate Blue Gradient */
#header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    padding: 12px 0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    border-bottom: 2px solid #3b82f6 !important;
    min-height: 40px !important;
}

#header .swagger-ui-wrap {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
    max-width: 1200px !important;
    padding: 0 24px !important;
}

#logo {
    font-size: 1.6em !important;
    font-weight: 700 !important;
    letter-spacing: -0.025em !important;
    color: #ffffff !important;
    text-transform: uppercase !important;
    background: none !important;
    padding-left: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    float: none !important;
}

#logo::before {
    content: "⚡" !important;
    margin-right: 8px !important;
    font-size: 1.2em !important;
}

#logo .logo__title {
    color: #ffffff !important;
    font-weight: 700 !important;
}

/* Header input search fields and buttons */
#api_selector {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
}

#api_selector .input {
    float: none !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

#api_selector input {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-size: 0.9em !important;
    height: 36px !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
    margin: 0 !important;
}

#api_selector input:focus {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: #3b82f6 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3) !important;
}

#api_selector a#explore, 
.swagger-section .swagger-ui-wrap #api_selector a#explore {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    padding: 0 20px !important;
    font-weight: 600 !important;
    font-size: 0.9em !important;
    height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2) !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
}

#api_selector a#explore:hover {
    background-color: #2563eb !important;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3) !important;
}

/* Wrapper Layout */
.swagger-section .swagger-ui-wrap {
    max-width: 1200px !important;
    padding: 0 24px !important;
}

/* Responsive adjustment for small screens */
@media (max-width: 900px) {
    #header {
        padding: 16px 0 !important;
    }
    
    #header .swagger-ui-wrap {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    
    #logo {
        justify-content: center !important;
    }
    
    #api_selector {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
    }
    
    #api_selector .input {
        width: 100% !important;
    }
    
    #api_selector input {
        width: 100% !important;
        text-align: center !important;
    }
    
    #api_selector a#explore {
        width: 100% !important;
    }
}

/* Main Info Block */
#api_info {
    margin: 30px 0 !important;
    background: #ffffff !important;
    padding: 24px !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1) !important;
    border-left: 5px solid #3b82f6 !important;
}

.info_title {
    font-size: 2.2em !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin-bottom: 8px !important;
}

.info_description {
    font-size: 1.1em !important;
    line-height: 1.6 !important;
    color: #475569 !important;
}

/* API Endpoints Container */
.swagger-section #resources_container {
    margin-top: 24px !important;
}

li.resource {
    margin-bottom: 20px !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1) !important;
    border: 1px solid #e2e8f0 !important;
    overflow: hidden !important;
}

li.resource .heading {
    padding: 16px 24px !important;
    background-color: #f8fafc !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

li.resource .heading h2 {
    font-size: 1.3em !important;
    font-weight: 600 !important;
    color: #1e293b !important;
}

li.resource .heading h2 a {
    color: #1e293b !important;
}

li.resource .heading ul.options li a {
    color: #64748b !important;
    font-size: 0.9em !important;
}

li.resource .heading ul.options li a:hover {
    color: #3b82f6 !important;
}

/* API Operations List styling */
ul.endpoints {
    padding: 8px !important;
}

.swagger-section .swagger-ui-wrap ul.endpoints li.endpoint {
    margin: 8px 0 !important;
}

.swagger-section .swagger-ui-wrap ul.endpoints li.endpoint .heading {
    border-radius: 8px !important;
    border: 1px solid transparent !important;
    transition: all 0.2s ease !important;
    padding: 10px 16px !important;
}

/* GET Method */
.swagger-section .swagger-ui-wrap ul.endpoints li.endpoint.get .heading {
    background-color: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
}
.swagger-section .swagger-ui-wrap ul.endpoints li.endpoint.get .heading h3 span.http_method a {
    background-color: #22c55e !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    padding: 4px 10px !important;
}
.swagger-section .swagger-ui-wrap ul.endpoints li.endpoint.get .heading h3 span.path a {
    color: #15803d !important;
    font-weight: 500 !important;
}

/* POST Method */
.swagger-section .swagger-ui-wrap ul.endpoints li.endpoint.post .heading {
    background-color: #eff6ff !important;
    border-color: #bfdbfe !important;
}
.swagger-section .swagger-ui-wrap ul.endpoints li.endpoint.post .heading h3 span.http_method a {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    padding: 4px 10px !important;
}
.swagger-section .swagger-ui-wrap ul.endpoints li.endpoint.post .heading h3 span.path a {
    color: #1d4ed8 !important;
    font-weight: 500 !important;
}

/* PUT Method */
.swagger-section .swagger-ui-wrap ul.endpoints li.endpoint.put .heading {
    background-color: #fef8e6 !important;
    border-color: #fef08a !important;
}
.swagger-section .swagger-ui-wrap ul.endpoints li.endpoint.put .heading h3 span.http_method a {
    background-color: #eab308 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    padding: 4px 10px !important;
}
.swagger-section .swagger-ui-wrap ul.endpoints li.endpoint.put .heading h3 span.path a {
    color: #a16207 !important;
    font-weight: 500 !important;
}

/* DELETE Method */
.swagger-section .swagger-ui-wrap ul.endpoints li.endpoint.delete .heading {
    background-color: #fef2f2 !important;
    border-color: #fecaca !important;
}
.swagger-section .swagger-ui-wrap ul.endpoints li.endpoint.delete .heading h3 span.http_method a {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    padding: 4px 10px !important;
}
.swagger-section .swagger-ui-wrap ul.endpoints li.endpoint.delete .heading h3 span.path a {
    color: #b91c1c !important;
    font-weight: 500 !important;
}

/* Try it Out / Action Containers */
.swagger-section .swagger-ui-wrap ul.endpoints li.endpoint .content {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px !important;
    padding: 20px !important;
}

/* Authorize Button Styling */
.swagger-section .swagger-ui-wrap .auth_container {
    background: #ffffff !important;
    padding: 16px 20px !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
    border: 1px solid #e2e8f0 !important;
    margin-bottom: 20px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.swagger-section .swagger-ui-wrap .auth_container input[type="text"] {
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    min-width: 300px !important;
    font-size: 0.9em !important;
}

.swagger-section .swagger-ui-wrap .auth_container input[type="text"]:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

.swagger-section .swagger-ui-wrap .auth_container .auth_btn {
    background-color: #10b981 !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    font-weight: 600 !important;
    font-size: 0.9em !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.swagger-section .swagger-ui-wrap .auth_container .auth_btn:hover {
    background-color: #059669 !important;
}

/* Parameters and Response Headers UI */
.swagger-section .swagger-ui-wrap table.parameters th, 
.swagger-section .swagger-ui-wrap table.headers th {
    font-weight: 600 !important;
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    padding: 10px !important;
}

.swagger-section .swagger-ui-wrap table.parameters td,
.swagger-section .swagger-ui-wrap table.headers td {
    padding: 10px !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

/* Execute Button */
.swagger-section .swagger-ui-wrap input.sandbox_header {
    background-color: #475569 !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    padding: 8px 24px !important;
    font-weight: 600 !important;
    border: none !important;
    transition: all 0.2s ease !important;
}

.swagger-section .swagger-ui-wrap input.sandbox_header:hover {
    background-color: #334155 !important;
}

.swagger-section .swagger-ui-wrap .submit {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    padding: 8px 24px !important;
    font-weight: 600 !important;
    border: none !important;
    transition: all 0.2s ease !important;
}

.swagger-section .swagger-ui-wrap .submit:hover {
    background-color: #2563eb !important;
}

/* Text fields and Text Areas */
textarea, input[type="text"] {
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 8px !important;
    background-color: #ffffff !important;
}

textarea:focus, input[type="text"]:focus {
    border-color: #3b82f6 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

/* Force response JSON and long tokens to wrap, preventing horizontal scroll */
.swagger-section .swagger-ui-wrap pre,
.swagger-section .swagger-ui-wrap pre code,
.swagger-section .swagger-ui-wrap .response_body pre,
.swagger-section .swagger-ui-wrap .block pre {
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    word-break: break-all !important;
    overflow-x: auto !important;
}
