:root {
    --primary-color: #6200ee; /* Android Purple */
    --primary-dark: #3700b3;
    --background: #f5f5f5;
    --surface: #ffffff;
    --text-primary: #000000;
    --text-secondary: #666666;
    --divider: #e0e0e0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--site-background-colour);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* App Bar */
header {
    color: var(--primary-text);
    background-color: var(--primary);
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
    display: flex;
    align-items: center;
    padding-left: 150px;
    justify-content: space-between;
}

/* Gallery Grid */
.gallery-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.gallery-container p {
    color: rgba(0,0,0,0.6);
    font-size: 14px;
    margin-top: 8px;
    margin-bottom: 16px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.gallery-item {
    aspect-ratio: 1 / 1 !important;
    width: 100%;
    height: 100%;
    position: relative;
    background-color: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-item:active {
    transform: scale(0.98);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image fills the square without distortion */
    display: block;
}

/* Loading placeholder */
.placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #eee, #f5f5f5);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Full Screen Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    z-index: 100;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-image-container {
    max-width: 90%;
    max-height: 70%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.modal-image-container img {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

/* Modal Controls */
.modal-controls {
    margin-top: 24px;
    display: flex;
    gap: 16px;
    width: 100%;
    justify-content: center;
    padding: 0 20px;
}

.btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.5s;
}

.btn:hover{
    background-color: var(--secondary);
}

.btn:active {
    background-color: var(--secondary-dark);
    transform: translateY(1px);
}

.btn-close {
    background-color: transparent;
    color: white;
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 8px;
    border-radius: 50%;
    box-shadow: none;
}

.btn-close:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #323232;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 200;
    text-align: center;
    max-width: 90%;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}