import styled from 'styled-components';
import { lightGreenColor, darkGreenColor, blackColor, modalColor, whiteColor } from './colors';

export const AdminContainer = styled.div`
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    color: ${whiteColor};
    padding: 0;
    
    * {
        box-sizing: border-box;
    }
`;

export const AdminContent = styled.div`
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    
    @media (max-width: 768px) {
        padding: 1rem;
    }
`;

export const AdminHeaderStyled = styled.nav`
    background: rgba(15, 15, 23, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(109, 103, 148, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
`;

export const AdminHeaderContent = styled.div`
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    
    @media (max-width: 768px) {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
    }
`;

export const AdminLogo = styled.a`
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, ${lightGreenColor}, ${darkGreenColor});
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    transition: transform 0.2s;
    
    &:hover {
        transform: scale(1.05);
    }
`;

export const AdminNav = styled.ul`
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
    flex-wrap: wrap;
    
    @media (max-width: 768px) {
        gap: 0.75rem;
        justify-content: center;
    }
`;

export const AdminNavLink = styled.a<{ $active?: boolean }>`
    color: ${({ $active }) => ($active ? lightGreenColor : modalColor)};
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
    position: relative;
    
    &:hover {
        color: ${lightGreenColor};
        background: rgba(76, 230, 94, 0.1);
    }
    
    ${({ $active }) => $active && `
        background: rgba(76, 230, 94, 0.15);
        &::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 60%;
            height: 2px;
            background: ${lightGreenColor};
        }
    `}
`;

export const PageTitle = styled.h1`
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(90deg, ${lightGreenColor}, ${darkGreenColor});
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    
    @media (max-width: 768px) {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
`;

export const FiltersContainer = styled.div`
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    
    @media (max-width: 768px) {
        flex-direction: column;
        gap: 1rem;
    }
`;

export const FilterGroup = styled.div`
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
    
    @media (max-width: 768px) {
        width: 100%;
    }
`;

export const FilterLabel = styled.label`
    font-size: 0.875rem;
    color: ${modalColor};
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
`;

export const FilterInput = styled.input`
    background: rgba(15, 15, 23, 0.8);
    border: 1px solid rgba(109, 103, 148, 0.3);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: ${whiteColor};
    font-size: 1rem;
    transition: all 0.2s;
    
    &:focus {
        outline: none;
        border-color: ${lightGreenColor};
        background: rgba(15, 15, 23, 0.95);
        box-shadow: 0 0 0 3px rgba(76, 230, 94, 0.1);
    }
    
    &::-webkit-calendar-picker-indicator {
        filter: invert(1);
        opacity: 0.7;
    }
`;

export const FilterSelect = styled.select`
    background: rgba(15, 15, 23, 0.8);
    border: 1px solid rgba(109, 103, 148, 0.3);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: ${whiteColor};
    font-size: 1rem;
    transition: all 0.2s;
    cursor: pointer;
    
    &:focus {
        outline: none;
        border-color: ${lightGreenColor};
        background: rgba(15, 15, 23, 0.95);
        box-shadow: 0 0 0 3px rgba(76, 230, 94, 0.1);
    }
    
    option {
        background: ${blackColor};
        color: ${whiteColor};
    }
`;

export const RoomCard = styled.div`
    background: rgba(15, 15, 23, 0.6);
    border: 1px solid rgba(109, 103, 148, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    
    &:hover {
        border-color: rgba(76, 230, 94, 0.3);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }
`;

export const RoomCardHeader = styled.div`
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(109, 103, 148, 0.2);
`;

export const RoomCardTitle = styled.h2`
    font-size: 1.5rem;
    font-weight: 600;
    color: ${whiteColor};
    margin: 0;
`;

export const RoomCapacity = styled.div`
    font-size: 0.875rem;
    color: ${modalColor};
    background: rgba(109, 103, 148, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
`;

export const TimeGrid = styled.div`
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    
    @media (max-width: 768px) {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.5rem;
    }
`;

export const TimeSlot = styled.div<{ $available: boolean; $booked: number; $capacity: number }>`
    background: ${({ $available, $booked, $capacity }) => {
        if ($booked === 0) return 'rgba(76, 230, 94, 0.1)';
        if ($booked >= $capacity) return 'rgba(220, 53, 69, 0.2)';
        return 'rgba(255, 193, 7, 0.15)';
    }};
    border: 1px solid ${({ $available, $booked, $capacity }) => {
        if ($booked === 0) return 'rgba(76, 230, 94, 0.3)';
        if ($booked >= $capacity) return 'rgba(220, 53, 69, 0.4)';
        return 'rgba(255, 193, 7, 0.4)';
    }};
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s;
    cursor: pointer;
    
    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
`;

export const TimeSlotHeader = styled.div`
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
`;

export const TimeSlotTime = styled.div`
    font-size: 1rem;
    font-weight: 600;
    color: ${whiteColor};
`;

export const TimeSlotCount = styled.div<{ $full: boolean }>`
    font-size: 0.75rem;
    color: ${({ $full }) => ($full ? '#dc3545' : '#4ce65e')};
    font-weight: 600;
`;

export const TimeSlotBookings = styled.div`
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 40px;
`;

export const BookingBadge = styled.span<{ $status: string }>`
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    background: ${({ $status }) => {
        if ($status === 'confirmed') return 'rgba(40, 167, 69, 0.3)';
        if ($status === 'cancelled') return 'rgba(220, 53, 69, 0.3)';
        return 'rgba(255, 193, 7, 0.3)';
    }};
    color: ${({ $status }) => {
        if ($status === 'confirmed') return '#28a745';
        if ($status === 'cancelled') return '#dc3545';
        return '#ffc107';
    }};
    border: 1px solid ${({ $status }) => {
        if ($status === 'confirmed') return 'rgba(40, 167, 69, 0.5)';
        if ($status === 'cancelled') return 'rgba(220, 53, 69, 0.5)';
        return 'rgba(255, 193, 7, 0.5)';
    }};
`;

export const BookingsList = styled.div`
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
`;

export const BookingCard = styled.div<{ $status: string }>`
    background: rgba(15, 15, 23, 0.6);
    border: 1px solid ${({ $status }) => {
        if ($status === 'confirmed') return 'rgba(40, 167, 69, 0.3)';
        if ($status === 'cancelled') return 'rgba(220, 53, 69, 0.3)';
        return 'rgba(255, 193, 7, 0.3)';
    }};
    border-left: 4px solid ${({ $status }) => {
        if ($status === 'confirmed') return '#28a745';
        if ($status === 'cancelled') return '#dc3545';
        return '#ffc107';
    }};
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
    
    &:hover {
        transform: translateX(4px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }
`;

export const BookingCardHeader = styled.div`
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
`;

export const BookingCardInfo = styled.div`
    flex: 1;
    min-width: 200px;
`;

export const BookingCardTitle = styled.h3`
    font-size: 1.25rem;
    font-weight: 600;
    color: ${whiteColor};
    margin: 0 0 0.5rem 0;
`;

export const BookingCardMeta = styled.div`
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: ${modalColor};
    margin-top: 0.5rem;
`;

export const BookingCardActions = styled.div`
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
`;

export const StatusSelect = styled.select<{ $status: string }>`
    background: rgba(15, 15, 23, 0.8);
    border: 1px solid ${({ $status }) => {
        if ($status === 'confirmed') return 'rgba(40, 167, 69, 0.5)';
        if ($status === 'cancelled') return 'rgba(220, 53, 69, 0.5)';
        return 'rgba(255, 193, 7, 0.5)';
    }};
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: ${whiteColor};
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    
    &:focus {
        outline: none;
        border-color: ${lightGreenColor};
        box-shadow: 0 0 0 3px rgba(76, 230, 94, 0.1);
    }
    
    option {
        background: ${blackColor};
        color: ${whiteColor};
    }
`;

export const DeleteButton = styled.button`
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #dc3545;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    
    &:hover {
        background: rgba(220, 53, 69, 0.3);
        border-color: #dc3545;
        transform: translateY(-1px);
    }
`;

export const EmptyState = styled.div`
    text-align: center;
    padding: 4rem 2rem;
    color: ${modalColor};
`;

export const EmptyStateIcon = styled.div`
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
`;

export const EmptyStateText = styled.p`
    font-size: 1.125rem;
    margin: 0;
`;

export const LoadingSpinner = styled.div`
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
`;

export const Spinner = styled.div`
    width: 48px;
    height: 48px;
    border: 4px solid rgba(109, 103, 148, 0.2);
    border-top-color: ${lightGreenColor};
    border-radius: 50%;
    animation: spin 1s linear infinite;
    
    @keyframes spin {
        to { transform: rotate(360deg); }
    }
`;

export const SectionTitle = styled.h2`
    font-size: 1.5rem;
    font-weight: 600;
    color: ${whiteColor};
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(109, 103, 148, 0.2);
`;

export const AddButton = styled.button`
    background: linear-gradient(90deg, ${lightGreenColor}, ${darkGreenColor});
    border: none;
    color: ${blackColor};
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    
    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(76, 230, 94, 0.3);
    }
    
    &:active {
        transform: translateY(0);
    }
`;

export const ModalOverlay = styled.div`
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
`;

export const ModalContent = styled.form`
    background: rgba(15, 15, 23, 0.95);
    border: 1px solid rgba(109, 103, 148, 0.3);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    
    &::-webkit-scrollbar {
        width: 6px;
    }

    &::-webkit-scrollbar-thumb {
        background-color: rgba(109, 103, 148, 0.5);
        border-radius: 6px;
    }

    &::-webkit-scrollbar-track {
        background: transparent;
    }
`;

export const ModalHeader = styled.div`
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(109, 103, 148, 0.2);
`;

export const ModalTitle = styled.h3`
    font-size: 1.5rem;
    color: ${whiteColor};
    margin: 0;
    background: linear-gradient(90deg, ${lightGreenColor}, ${darkGreenColor});
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
`;

export const ModalCloseButton = styled.button`
    background: transparent;
    border: none;
    color: ${modalColor};
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    
    &:hover {
        background: rgba(109, 103, 148, 0.2);
        color: ${whiteColor};
    }
`;

export const ModalBody = styled.div`
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
`;

export const FormRow = styled.div`
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    
    @media (max-width: 600px) {
        grid-template-columns: 1fr;
    }
`;

export const FormLabel = styled.label`
    display: block;
    font-size: 0.875rem;
    color: ${modalColor};
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
`;

export const FormInput = styled(FilterInput)`
    width: 100%;
`;

export const FormSelect = styled(FilterSelect)`
    width: 100%;
`;

export const ModalFooter = styled.div`
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(109, 103, 148, 0.2);
`;

export const CancelButton = styled.button`
    background: rgba(109, 103, 148, 0.2);
    border: 1px solid rgba(109, 103, 148, 0.4);
    color: ${modalColor};
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    
    &:hover {
        background: rgba(109, 103, 148, 0.3);
        border-color: ${modalColor};
    }
`;

export const SubmitButton = styled.button`
    background: linear-gradient(90deg, ${lightGreenColor}, ${darkGreenColor});
    border: none;
    color: ${blackColor};
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    
    &:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(76, 230, 94, 0.3);
    }
    
    &:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }
`;

export const ErrorMessage = styled.div`
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #dc3545;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-top: 0.5rem;
`;
