/**
 * Functional Blocks Styles
 * Block 컴포넌트들의 공통 스타일
 */

/* Popup/Modal Styles */
.ic-popup-trigger {
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    background-color: #0d6efd;
    color: #fff;
    border: 1px solid #0d6efd;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.ic-popup-trigger:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    color: #fff;
}

.ic-popup-trigger:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    outline: 0;
}

.ic-popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1055;
}

.ic-popup-sm {
    max-width: 300px;
    width: 90%;
}

.ic-popup-md {
    max-width: 500px;
    width: 90%;
}

.ic-popup-lg {
    max-width: 800px;
    width: 90%;
}

.ic-popup-card {
    background-color: #fff;
    border-radius: 0.5rem;
    padding: 0;
    max-height: 90vh;
    overflow: hidden;
    width: 100%;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.ic-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1rem;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: calc(0.5rem - 1px);
    border-top-right-radius: calc(0.5rem - 1px);
}

.ic-popup-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.2;
    color: #212529;
}

.ic-popup-close {
    background: transparent;
    border: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: 0.5;
    cursor: pointer;
    padding: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease-in-out;
}

.ic-popup-close:hover {
    opacity: 0.75;
    color: #000;
}

.ic-popup-body {
    padding: 1rem;
    flex: 1 1 auto;
    overflow-y: auto;
}

/* Table Styles */
.ic-table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    vertical-align: top;
    border-color: #dee2e6;
    border-collapse: collapse;
}

.ic-table > :not(caption) > * > * {
    padding: 0.5rem 0.5rem;
    background-color: #fff;
    border-bottom-width: 1px;
}

.ic-table-bordered {
    border: 1px solid #dee2e6;
}

.ic-table-bordered > :not(caption) > * {
    border-width: 1px 0;
}

.ic-table-bordered > :not(caption) > * > * {
    border-width: 0 1px;
    border-color: #dee2e6;
}

.ic-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: inherit;
    text-align: -webkit-match-parent;
    color: #212529;
    border-bottom: 2px solid #dee2e6;
    padding: 0.75rem;
    vertical-align: bottom;
}

.ic-table td {
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem;
    vertical-align: top;
}

.ic-table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(0, 0, 0, 0.02);
    color: #212529;
}

.ic-table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: #fff;
}

.ic-table-compact th,
.ic-table-compact td {
    padding: 0.25rem;
}

/* Upload Styles */
.ic-upload-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ic-upload-button {
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    background-color: #0d6efd;
    color: #fff;
    border: 1px solid #0d6efd;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.ic-upload-button:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    color: #fff;
}

.ic-upload-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    outline: 0;
}

.ic-upload-input {
    display: none;
}

.ic-upload-file-list {
    font-size: 0.875rem;
    color: #212529;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin-top: 0.5rem;
}

/* List Styles */
.ic-list-widget,
[data-widget="List"] {
    width: 100%;
    box-sizing: border-box;
}

.ic-list-widget[data-datasource=""],
[data-widget="List"][data-datasource=""] {
    min-height: 100px;
}

.ic-list-widget [data-list-placeholder],
[data-widget="List"] [data-list-placeholder] {
    pointer-events: none;
}

.os-list-container {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 12px;
    width: 100%;
}

.os-list-item {
    width: 100%;
    box-sizing: border-box;
}

/* Dropdown Styles */
.ic-dropdown-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ic-dropdown-label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: #212529;
}

.ic-dropdown-select {
    display: block;
    width: 100%;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    appearance: none;
}

.ic-dropdown-select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.ic-dropdown-select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 1;
}

/* Checkbox Styles */
.ic-checkbox-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ic-checkbox-label {
    cursor: pointer;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    margin-bottom: 0;
    margin-left: 0.5rem;
}

.ic-checkbox-input {
    width: 1em;
    height: 1em;
    margin-top: 0.25em;
    vertical-align: top;
    background-color: #fff;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border: 1px solid #dee2e6;
    border-radius: 0.25em;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, background-position 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    flex-shrink: 0;
}

.ic-checkbox-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}

.ic-checkbox-input:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.ic-checkbox-input:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.6;
}

.ic-checkbox-group-label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: #212529;
}

.ic-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Button Styles */
.as-btn {
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    border: 1px solid transparent;
}

/* Button Type: Solid Primary */
.as-btn.as-btn-primary {
    background-color: #0d6efd;
    color: #fff;
    border: 1px solid #0d6efd;
}

.as-btn.as-btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.as-btn.as-btn-primary:active,
.as-btn.as-btn-primary:focus {
    background-color: #0a58ca;
    border-color: #0a3622;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.5);
}

/* Button Type: Solid Secondary */
.as-btn.as-btn-secondary {
    background-color: #6c757d;
    color: #fff;
    border: 1px solid #6c757d;
}

.as-btn.as-btn-secondary:hover {
    background-color: #5c636a;
    border-color: #565e64;
}

.as-btn.as-btn-secondary:active,
.as-btn.as-btn-secondary:focus {
    background-color: #565e64;
    border-color: #51585e;
    box-shadow: 0 0 0 0.25rem rgba(108, 117, 125, 0.5);
}

/* Button Type: Outline Primary */
.as-btn.as-btn-outline {
    background-color: transparent;
    color: #0d6efd;
    border: 1px solid #0d6efd;
}

.as-btn.as-btn-outline:hover {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.as-btn.as-btn-outline:active,
.as-btn.as-btn-outline:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.5);
}

/* Button Type: Outline Secondary */
.as-btn.as-btn-outline-secondary {
    background-color: transparent;
    color: #6c757d;
    border: 1px solid #6c757d;
}

.as-btn.as-btn-outline-secondary:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.as-btn.as-btn-outline-secondary:active,
.as-btn.as-btn-outline-secondary:focus {
    box-shadow: 0 0 0 0.25rem rgba(108, 117, 125, 0.5);
}

/* Button Disabled State */
.as-btn:disabled {
    background-color: #e9ecef;
    border-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 1;
}

/* Card Styles */
.ic-card {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.ic-card-header {
    padding: 1rem 1rem;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 1rem;
    color: #212529;
}

.ic-card-body {
    padding: 1rem;
    color: #212529;
    font-size: 0.95rem;
    line-height: 1.5;
}

.ic-card-footer {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Radio Group Styles */
.ic-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ic-radio-group-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
}

.ic-radio-options {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.ic-radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.ic-radio-input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    cursor: pointer;
    accent-color: #0d6efd;
}

.ic-radio-label {
    font-size: 0.875rem;
    color: #212529;
    cursor: pointer;
}

.ic-radio-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ic-radio-input:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Divider Styles */
.ic-divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    height: 0;
    margin: 1rem 0;
}
