/* 
========================================
🎨 Admin Panel CSS - IBM Carbon Design System
관리자 패널 전용 스타일시트
========================================
*/

/* Carbon Design System 커스터마이징 */
:root {
    --cds-background: #f4f4f4;
    --cds-layer-01: #ffffff;
    --cds-layer-02: #f4f4f4;
    --cds-border-subtle: #e0e0e0;
    --cds-border-strong: #8d8d8d;
    --cds-text-primary: #161616;
    --cds-text-secondary: #525252;
    --cds-text-helper: #6f6f6f;
    --cds-text-inverse: #ffffff;
    --cds-support-error: #da1e28;
    --cds-support-success: #24a148;
    --cds-support-warning: #f1c21b;
    --cds-support-info: #0043ce;
    --cds-interactive-01: #0f62fe;
    --cds-interactive-02: #393939;
    --cds-hover-primary: #0353e9;
    --cds-hover-secondary: #4c4c4c;
    --cds-field-01: #f4f4f4;
    --cds-field-02: #ffffff;
}

/* ===========================================
   Header 커스터마이징
   =========================================== */
.cds--header {
    background-color: var(--cds-interactive-02);
    border-bottom: 1px solid var(--cds-border-subtle);
    height: 48px;
}

.cds--header__name--prefix {
    color: var(--cds-text-inverse) !important;
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.16px;
}

.cds--header__action-btn {
    background-color: transparent;
    border: none;
    color: var(--cds-text-inverse);
    padding: 0.75rem;
    transition: background-color 0.11s;
}

.cds--header__action-btn:hover {
    background-color: var(--cds-hover-secondary);
}

/* ===========================================
   Side Navigation 커스터마이징
   =========================================== */
.cds--side-nav {
    background-color: var(--cds-layer-01);
    border-right: 1px solid var(--cds-border-subtle);
}

.cds--side-nav__header-text {
    color: var(--cds-text-primary);
    border-bottom: 1px solid var(--cds-border-subtle);
}

.cds--side-nav__link {
    color: var(--cds-text-secondary) !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    transition: all 0.11s;
    border-left: 4px solid transparent;
}

.cds--side-nav__link:hover {
    background-color: var(--cds-layer-02);
    color: var(--cds-text-primary) !important;
}

.cds--side-nav__link.active {
    background-color: var(--cds-interactive-01);
    color: var(--cds-text-inverse) !important;
    border-left-color: var(--cds-interactive-01);
}

.cds--side-nav__link-text {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.16px;
}

/* ===========================================
   Tile 커스터마이징
   =========================================== */
.cds--tile {
    background-color: var(--cds-layer-01);
    border: 1px solid var(--cds-border-subtle);
    border-radius: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.cds--tile--light {
    background-color: var(--cds-layer-01);
    border: 1px solid var(--cds-border-subtle);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
}

/* ===========================================
   Button 커스터마이징
   =========================================== */
.cds--btn {
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.16px;
    padding: 0.875rem 1rem;
    transition: all 0.11s;
}

.cds--btn--primary {
    background-color: var(--cds-interactive-01);
    border: 1px solid var(--cds-interactive-01);
    color: var(--cds-text-inverse);
}

.cds--btn--primary:hover {
    background-color: var(--cds-hover-primary);
    border-color: var(--cds-hover-primary);
}

.cds--btn--secondary {
    background-color: transparent;
    border: 1px solid var(--cds-interactive-02);
    color: var(--cds-interactive-02);
}

.cds--btn--secondary:hover {
    background-color: var(--cds-hover-secondary);
    color: var(--cds-text-inverse);
}

.cds--btn--tertiary {
    background-color: transparent;
    border: 1px solid var(--cds-interactive-01);
    color: var(--cds-interactive-01);
}

.cds--btn--tertiary:hover {
    background-color: rgba(15, 98, 254, 0.1);
}

.cds--btn--danger {
    background-color: var(--cds-support-error);
    border: 1px solid var(--cds-support-error);
    color: var(--cds-text-inverse);
}

.cds--btn--danger:hover {
    background-color: #ba1b23;
    border-color: #ba1b23;
}

/* ===========================================
   Typography
   =========================================== */
.cds--type-heading-02 {
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
}

.cds--type-body-01 {
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.42857;
    letter-spacing: 0.16px;
}

.cds--type-caption-01 {
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.33333;
    letter-spacing: 0.32px;
}

.cds--type-productive-heading-02 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.375;
    letter-spacing: 0;
}

.cds--type-productive-heading-03 {
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0;
}

.cds--type-productive-heading-04 {
    font-size: 1.75rem;
    font-weight: 400;
    line-height: 1.29;
    letter-spacing: 0;
}

/* ===========================================
   Carbon Tabs customization
   =========================================== */
.cds--tabs {
    margin-bottom: 2rem;
}

.cds--tab-list {
    background-color: var(--cds-layer-01);
    border-bottom: 1px solid var(--cds-border-subtle);
}

.cds--tab {
    color: var(--cds-text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.11s;
}

.cds--tab:hover {
    color: var(--cds-text-primary);
    background-color: var(--cds-layer-02);
}

.cds--tab[aria-selected="true"] {
    color: var(--cds-interactive-01);
    border-bottom-color: var(--cds-interactive-01);
    background-color: var(--cds-layer-01);
}

.cds--tab-panel {
    background-color: var(--cds-layer-01);
    border: 1px solid var(--cds-border-subtle);
    border-top: none;
    border-radius: 0 0 8px 8px;
}

/* ===========================================
   Carbon Form customization
   =========================================== */
.cds--label {
    font-weight: 600;
    color: var(--cds-text-primary);
    margin-bottom: 0.5rem;
    display: block;
}

.cds--text-area {
    background-color: var(--cds-field-01);
    border: 1px solid var(--cds-border-strong);
    color: var(--cds-text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.42857;
    padding: 0.75rem;
    resize: vertical;
    width: 100%;
    border-radius: 0;
    transition: all 0.11s;
}

.cds--text-area:focus {
    border-color: var(--cds-interactive-01);
    outline: 2px solid var(--cds-interactive-01);
    outline-offset: -2px;
}

.cds--text-input {
    background-color: var(--cds-field-01);
    border: 1px solid var(--cds-border-strong);
    color: var(--cds-text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.42857;
    padding: 0.75rem;
    width: 100%;
    border-radius: 0;
    transition: all 0.11s;
}

.cds--text-input:focus {
    border-color: var(--cds-interactive-01);
    outline: 2px solid var(--cds-interactive-01);
    outline-offset: -2px;
}

.cds--form__helper-text {
    color: var(--cds-text-helper);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* ===========================================
   Carbon Checkbox customization
   =========================================== */
.cds--checkbox-wrapper {
    margin-bottom: 0.75rem;
}

.cds--checkbox {
    opacity: 0;
    position: absolute;
}

.cds--checkbox-label {
    color: var(--cds-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    line-height: 1.42857;
    padding-left: 1.5rem;
    position: relative;
}

.cds--checkbox-label::before {
    background-color: var(--cds-field-01);
    border: 1px solid var(--cds-border-strong);
    content: '';
    height: 1rem;
    left: 0;
    position: absolute;
    top: 0.125rem;
    width: 1rem;
    transition: all 0.11s;
}

.cds--checkbox:checked + .cds--checkbox-label::before {
    background-color: var(--cds-interactive-01);
    border-color: var(--cds-interactive-01);
}

.cds--checkbox:checked + .cds--checkbox-label::after {
    border-color: white;
    border-style: solid;
    border-width: 0 2px 2px 0;
    content: '';
    height: 0.375rem;
    left: 0.25rem;
    position: absolute;
    top: 0.25rem;
    transform: rotate(45deg);
    width: 0.25rem;
}

/* ===========================================
   Carbon Loading
   =========================================== */
.cds--loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
}

.cds--loading__svg {
    animation: rotate 2s linear infinite;
    width: 100%;
    height: 100%;
}

.cds--loading__background {
    fill: none;
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 8;
}

.cds--loading__stroke {
    fill: none;
    stroke: white;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: loading 2s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes loading {
    0% {
        stroke-dasharray: 0, 200;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 100, 200;
        stroke-dashoffset: -15;
    }
    100% {
        stroke-dasharray: 100, 200;
        stroke-dashoffset: -125;
    }
}

/* ===========================================
   Carbon Notifications
   =========================================== */
.cds--inline-notification {
    background-color: var(--cds-layer-01);
    border-left: 4px solid var(--cds-support-info);
    margin-bottom: 1rem;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    min-height: 3rem;
}

.cds--inline-notification--success {
    border-left-color: var(--cds-support-success);
}

.cds--inline-notification--error {
    border-left-color: var(--cds-support-error);
}

.cds--inline-notification--warning {
    border-left-color: var(--cds-support-warning);
}

.cds--inline-notification__icon {
    margin-right: 0.75rem;
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.cds--inline-notification__text-wrapper {
    flex: 1;
}

.cds--inline-notification__title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--cds-text-primary);
}

.cds--inline-notification__subtitle {
    color: var(--cds-text-secondary);
    font-size: 0.875rem;
}

.cds--inline-notification__close-button {
    background: transparent;
    border: none;
    color: var(--cds-text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.75rem;
}

.cds--inline-notification__close-button:hover {
    color: var(--cds-text-primary);
}

/* ===========================================
   Admin-specific Components
   =========================================== */

/* Action Toolbar */
.action-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--cds-layer-01);
    border: 1px solid var(--cds-border-subtle);
    border-radius: 8px;
}

.action-toolbar h1 {
    margin: 0;
    color: var(--cds-text-primary);
    font-size: 1.5rem;
    font-weight: 400;
}

.action-toolbar .btn-group {
    display: flex;
    gap: 0.5rem;
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-indicator--success {
    background-color: rgba(36, 161, 72, 0.1);
    color: var(--cds-support-success);
}

.status-indicator--error {
    background-color: rgba(218, 30, 40, 0.1);
    color: var(--cds-support-error);
}

.status-indicator--warning {
    background-color: rgba(241, 194, 27, 0.1);
    color: var(--cds-support-warning);
}

.status-indicator--info {
    background-color: rgba(0, 67, 206, 0.1);
    color: var(--cds-support-info);
}

/* Configuration Sections */
.config-section {
    margin-bottom: 2rem;
    background-color: var(--cds-layer-01);
    border: 1px solid var(--cds-border-subtle);
    border-radius: 8px;
    overflow: hidden;
}

.config-section__header {
    background-color: var(--cds-layer-02);
    border-bottom: 1px solid var(--cds-border-subtle);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.config-section__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--cds-text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-section__content {
    padding: 1.5rem;
}

.config-section__description {
    color: var(--cds-text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group__label {
    display: block;
    font-weight: 600;
    color: var(--cds-text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-group__helper {
    color: var(--cds-text-helper);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* Prompt Engineering Sections */
.prompt-section {
    background-color: var(--cds-field-01);
    border: 1px solid var(--cds-border-subtle);
    border-radius: 4px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.prompt-section__header {
    background-color: var(--cds-layer-02);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--cds-border-subtle);
    font-weight: 600;
    color: var(--cds-text-primary);
    font-size: 0.875rem;
}

.prompt-section__content {
    padding: 1rem;
}

/* Character Counter */
.character-counter {
    text-align: right;
    font-size: 0.75rem;
    color: var(--cds-text-helper);
    margin-top: 0.25rem;
}

.character-counter--warning {
    color: var(--cds-support-warning);
}

.character-counter--error {
    color: var(--cds-support-error);
}

/* ===========================================
   SystemPrompts Page Specific Styles
   =========================================== */

/* System Prompts Admin Container */
.system-prompts-admin {
    background-color: var(--cds-background);
    padding: 0;
}

/* Prompt Status Indicator */
.prompt-status-indicator {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.prompt-status-indicator.loading {
    background-color: rgba(255, 255, 255, 0.1);
}

.prompt-status-indicator.ready {
    background-color: rgba(66, 190, 101, 0.2);
}

/* Enhanced Action Toolbar for SystemPrompts */
.system-prompts-admin .action-toolbar {
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Carbon Tile Light Variation */
.cds--tile--light {
    background-color: var(--cds-layer-01);
    border: 1px solid var(--cds-border-subtle);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
}

/* ===========================================
   Responsive Design
   =========================================== */
@media (max-width: 1056px) {
    .cds--side-nav {
        transform: translateX(-100%);
        transition: transform 0.11s;
    }

    .cds--content {
        margin-left: 0 !important;
    }
}

@media (max-width: 672px) {
    .action-toolbar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch !important;
    }

    .action-toolbar > div:last-child {
        justify-content: stretch;
    }

    .action-toolbar > div:last-child > * {
        flex: 1;
    }

    .config-section__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .config-section__content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .action-toolbar {
        padding: 0.75rem;
    }

    .config-section__content {
        padding: 0.75rem;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .cds--btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
} 