// Variables
$transition-speed: var(--transition);
$border-radius: 8px;
$spacing-unit: 1rem;

// Mixins
@mixin flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

@mixin card {
    background: var(--background);
    border-radius: $border-radius;
    box-shadow: var(--transp-2);
    transition: transform $transition-speed, box-shadow $transition-speed;

    &:hover {
        transform: translateY(-2px);
        box-shadow: var(--transp-4);
    }
}

// Page Info
.page-info {
    &-route {
        font-family: monospace;
        font-size: 0.875rem;
        color: var(--text-500);
        background: var(--transp-1);
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
        margin-top: 0.25rem;
        display: inline-block;
    }

    &-title {
        font-weight: 600;
        color: var(--text);
        margin-bottom: 0.25rem;
    }

    &-description {
        color: var(--text-500);
        font-size: 0.875rem;
        margin-top: 0.5rem;
        line-height: 1.4;
    }
}

// Page Blocks
.page-blocks {
    &-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: $spacing-unit * 1.5;
    }

    &-title {
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--text);
        margin: 0;
    }

    &-empty {
        @include card;
        padding: $spacing-unit * 3;
        text-align: center;

        &-icon {
            font-size: 3rem;
            color: var(--text-500);
            margin-bottom: $spacing-unit;
        }

        &-title {
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--text);
            margin: 0 0 $spacing-unit * 0.5;
        }

        &-text {
            color: var(--text-500);
            margin: 0;
        }
    }
}

.page-block {
    @include card;
    padding: $spacing-unit;
    margin-bottom: $spacing-unit;

    &-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: $spacing-unit;
    }

    &-widget {
        font-weight: 600;
        color: var(--text);
        display: flex;
        align-items: center;
        gap: 0.5rem;

        &-icon {
            width: 24px;
            height: 24px;
            @include flex-center;
            background: var(--accent);
            color: white;
            border-radius: 4px;
            font-size: 0.875rem;
        }
    }

    &-settings {
        font-family: monospace;
        font-size: 0.75rem;
        background: var(--transp-1);
        padding: 0.5rem;
        border-radius: 4px;
        margin-top: 0.5rem;
        max-height: 100px;
        overflow-y: auto;
        white-space: pre-wrap;
    }

    &-actions {
        display: flex;
        gap: 0.5rem;
    }
}

// JSON Editor
.json-editor {
    &-container {
        position: relative;
    }

    &-textarea {
        font-family: monospace;
        font-size: 0.875rem;
        line-height: 1.5;
        resize: vertical;
        min-height: 120px;
    }

    &-error {
        color: var(--error);
        font-size: 0.75rem;
        margin-top: 0.25rem;
        display: none;

        &.show {
            display: block;
        }
    }

    &-valid {
        color: var(--success);
        font-size: 0.75rem;
        margin-top: 0.25rem;
        display: none;

        &.show {
            display: block;
        }
    }
}

// Route Input
.route-input {
    &-container {
        position: relative;
    }

    &-prefix {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-500);
        font-size: 0.875rem;
        pointer-events: none;
        z-index: 1;
    }

    &-field {
        padding-left: 2rem !important;
    }
}

// Permissions
.page-permissions {
    &-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: $spacing-unit;
    }

    &-item {
        @include card;
        padding: $spacing-unit;
        display: flex;
        align-items: center;
        gap: $spacing-unit;

        &-checkbox {
            flex-shrink: 0;
        }

        &-info {
            flex: 1;
        }

        &-name {
            font-weight: 500;
            color: var(--text);
            margin-bottom: 0.25rem;
        }

        &-description {
            font-size: 0.75rem;
            color: var(--text-500);
            line-height: 1.3;
        }
    }
} 