/*
    Предрейсовые осмотры - мобильное приложение
    Стили диалога выбора организации
*/

//---------------------
//Подключение библиотек
//---------------------

const { StyleSheet } = require('react-native');
const { APP_COLORS } = require('../../config/theme');
const { UI } = require('../../config/appConfig');
const { responsiveSpacing, heightPercentage } = require('../../utils/responsive');

//-----------
//Тело модуля
//-----------

const styles = StyleSheet.create({
    overlay: {
        flex: 1,
        backgroundColor: APP_COLORS.overlay,
        justifyContent: 'center',
        alignItems: 'center',
        padding: UI.PADDING
    },
    dialog: {
        backgroundColor: APP_COLORS.surface,
        borderRadius: UI.BORDER_RADIUS,
        width: '100%',
        maxWidth: 400,
        maxHeight: heightPercentage(80),
        flexDirection: 'column'
    },
    header: {
        flexDirection: 'row',
        alignItems: 'center',
        justifyContent: 'center',
        paddingHorizontal: UI.PADDING,
        paddingTop: UI.PADDING,
        paddingBottom: responsiveSpacing(3),
        borderBottomWidth: StyleSheet.hairlineWidth,
        borderBottomColor: APP_COLORS.borderSubtle,
        position: 'relative'
    },
    title: {
        textAlign: 'center',
        color: APP_COLORS.textPrimary,
        flex: 1,
        paddingHorizontal: 40
    },
    closeButton: {
        position: 'absolute',
        right: UI.PADDING,
        top: UI.PADDING,
        width: 32,
        height: 32,
        borderRadius: 16,
        alignItems: 'center',
        justifyContent: 'center'
    },
    closeButtonPressed: {
        backgroundColor: APP_COLORS.surfaceAlt
    },
    closeIcon: {
        width: 16,
        height: 16,
        alignItems: 'center',
        justifyContent: 'center'
    },
    closeIconLine1: {
        position: 'absolute',
        width: 16,
        height: 2,
        backgroundColor: APP_COLORS.textSecondary,
        borderRadius: 1,
        transform: [{ rotate: '45deg' }]
    },
    closeIconLine2: {
        position: 'absolute',
        width: 16,
        height: 2,
        backgroundColor: APP_COLORS.textSecondary,
        borderRadius: 1,
        transform: [{ rotate: '-45deg' }]
    },
    list: {
        flexGrow: 0,
        flexShrink: 1
    },
    listContent: {
        paddingVertical: responsiveSpacing(2)
    },
    organizationItem: {
        paddingHorizontal: UI.PADDING,
        paddingVertical: responsiveSpacing(3),
        borderBottomWidth: StyleSheet.hairlineWidth,
        borderBottomColor: APP_COLORS.borderSubtle
    },
    organizationItemSelected: {
        backgroundColor: APP_COLORS.primaryExtraLight
    },
    organizationItemPressed: {
        backgroundColor: APP_COLORS.surfaceAlt
    },
    organizationName: {
        fontSize: UI.FONT_SIZE_MD,
        color: APP_COLORS.textPrimary
    },
    organizationNameSelected: {
        color: APP_COLORS.primary,
        fontWeight: '600'
    },
    footer: {
        flexDirection: 'row',
        padding: UI.PADDING,
        borderTopWidth: StyleSheet.hairlineWidth,
        borderTopColor: APP_COLORS.borderSubtle,
        gap: responsiveSpacing(3),
        flexShrink: 0
    },
    cancelButton: {
        flex: 1,
        backgroundColor: APP_COLORS.surfaceAlt
    },
    cancelButtonText: {
        color: APP_COLORS.textPrimary
    },
    confirmButton: {
        flex: 1,
        backgroundColor: APP_COLORS.primary
    },
    confirmButtonText: {
        color: APP_COLORS.white
    }
});

//----------------
//Интерфейс модуля
//----------------

module.exports = styles;
