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

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

const { StyleSheet, Platform, Dimensions } = require('react-native'); //StyleSheet React Native
const { APP_COLORS } = require('../../config/theme'); //Цветовая схема приложения
const { UI } = require('../../config/appConfig'); //Конфигурация UI
const { responsiveSpacing, widthPercentage } = require('../../utils/responsive'); //Адаптивные утилиты

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

const windowSize = Dimensions.get('window');
const resultCardWidth = widthPercentage(92);

//Стили модального окна результата сканирования
const styles = StyleSheet.create({
    modalRoot: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: APP_COLORS.overlay
    },
    overlayContent: {
        position: 'absolute',
        left: 0,
        right: 0,
        top: 0,
        bottom: 0,
        justifyContent: 'center',
        alignItems: 'center',
        zIndex: 1001
    },
    overlay: {
        position: 'absolute',
        left: 0,
        top: 0,
        width: windowSize.width,
        height: windowSize.height,
        backgroundColor: APP_COLORS.overlay,
        zIndex: 1000
    },
    backdrop: {
        position: 'absolute',
        left: 0,
        right: 0,
        top: 0,
        bottom: 0,
        justifyContent: 'center',
        alignItems: 'center',
        paddingHorizontal: UI.PADDING
    },
    container: {
        width: resultCardWidth,
        minWidth: resultCardWidth,
        maxWidth: resultCardWidth,
        backgroundColor: APP_COLORS.surface,
        borderRadius: UI.BORDER_RADIUS,
        ...Platform.select({
            ios: {
                shadowColor: APP_COLORS.black,
                shadowOpacity: 0.25,
                shadowRadius: 10,
                shadowOffset: { width: 0, height: 4 }
            },
            android: {
                elevation: 10
            },
            web: {
                boxShadow: '0 4px 10px rgba(0, 0, 0, 0.25)'
            }
        })
    },
    header: {
        flexDirection: 'row',
        alignItems: 'center',
        justifyContent: 'space-between',
        paddingHorizontal: UI.PADDING,
        paddingVertical: responsiveSpacing(3),
        borderBottomWidth: StyleSheet.hairlineWidth,
        borderBottomColor: APP_COLORS.borderSubtle
    },
    title: {
        fontSize: UI.FONT_SIZE_LG,
        fontWeight: '600',
        color: APP_COLORS.textPrimary,
        flex: 1
    },
    closeButton: {
        width: responsiveSpacing(8),
        height: responsiveSpacing(8),
        borderRadius: responsiveSpacing(4),
        alignItems: 'center',
        justifyContent: 'center',
        backgroundColor: APP_COLORS.surfaceAlt
    },
    closeButtonText: {
        fontSize: responsiveSpacing(6),
        color: APP_COLORS.textSecondary,
        fontWeight: '300',
        lineHeight: responsiveSpacing(8)
    },
    content: {
        paddingHorizontal: UI.PADDING,
        paddingVertical: responsiveSpacing(4)
    },
    typeLabel: {
        marginBottom: responsiveSpacing(1),
        color: APP_COLORS.textSecondary
    },
    valueBlock: {
        width: '100%',
        paddingVertical: responsiveSpacing(2),
        paddingHorizontal: responsiveSpacing(3),
        backgroundColor: APP_COLORS.surfaceAlt,
        borderRadius: UI.BORDER_RADIUS,
        marginBottom: responsiveSpacing(4)
    },
    valueText: {
        width: '100%',
        fontSize: UI.FONT_SIZE_MD,
        color: APP_COLORS.textPrimary
    },
    buttonsRow: {
        flexDirection: 'row',
        justifyContent: 'flex-end'
    }
});

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

module.exports = styles;
