/* ========================================
   LoeschNetz - Public PWA Styles
   Mobile-First Design
   ======================================== */

/* === CSS Variables === */
:root {
    --primary-color: #d32f2f;
    --primary-dark: #9a0007;
    --primary-light: #ff6659;
    --secondary-color: #424242;
    --background: #ffffff;
    --surface: #f5f5f5;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border: #e0e0e0;
    --success: #4caf50;
    --warning: #ff9800;
    --error: #f44336;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-strong: rgba(0, 0, 0, 0.2);
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
                 Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-primary);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Cookie Consent Banner === */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 3px solid var(--primary-color);
    box-shadow: 0 -4px 12px var(--shadow-strong);
    z-index: 10000;
    padding: 20px;
}

.cookie-content {
    max-width: 800px;
    margin: 0 auto;
}

.cookie-content h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.cookie-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.cookie-highlight {
    color: var(--success);
    font-weight: 600;
}

.cookie-buttons {
    display: flex;
    gap: 12px;
    margin: 16px 0 12px 0;
    flex-wrap: wrap;
}

.cookie-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.cookie-link:hover {
    text-decoration: underline;
}

/* === Cookie Declined === */
.cookie-declined {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.declined-content {
    max-width: 500px;
    text-align: center;
}

.declined-content h2 {
    font-size: 2rem;
    margin-bottom: 16px;
    color: var(--warning);
}

.declined-content h3 {
    font-size: 1.1rem;
    margin: 24px 0 12px 0;
    text-align: left;
}

.declined-content ul {
    text-align: left;
    list-style-position: inside;
    margin-bottom: 24px;
    line-height: 1.8;
}

/* === Loading Screen === */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-content p {
    font-size: 1rem;
    margin: 0;
}

/* === Offline Notice === */
.offline-notice {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    z-index: 2000;
    box-shadow: 0 2px 8px var(--shadow-strong);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.offline-icon {
    font-size: 1.2rem;
}

.offline-text {
    font-weight: 500;
}

/* === App Container === */
#app {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* === Header === */
.app-header {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px var(--shadow);
    z-index: 1001;
    position: relative;
}

.app-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo {
    width: 32px;
    height: 32px;
    display: block;
}

.icon-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.icon-button:active {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0.95);
}

/* === Map Container === */
.map-container {
    flex: 1;
    position: relative;
    background: var(--surface);
    width: 100%;
    overflow: hidden;
    margin-bottom: 30px;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

/* === Leaflet Controls Position === */
.leaflet-top .leaflet-control {
    margin-top: 80px !important;
}

/* === Legend === */
.legend {
    position: absolute;
    top: 140px;
    right: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-strong);
    z-index: 1000;
    max-width: 200px;
}

.legend-toggle {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: white;
    border: none;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
    white-space: nowrap;
}

.legend-toggle:hover {
    background: var(--surface);
}

.legend-toggle::after {
    content: '▼';
    float: right;
    transition: transform 0.3s;
    margin-left: 8px;
}

.legend.collapsed .legend-toggle::after {
    transform: rotate(-90deg);
}

.legend-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.legend:not(.collapsed) .legend-content {
    max-height: 500px;
    padding: 8px 12px 12px 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    white-space: nowrap;
}

.legend-icon {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* === GPS Location Button === */
.gps-button {
    position: absolute;
    bottom: 80px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--shadow-strong);
    z-index: 1000;
    transition: all 0.2s;
}

.gps-button:hover {
    background: var(--surface);
    border-color: var(--primary-color);
}

.gps-button:active {
    transform: scale(0.95);
}

.gps-button svg {
    color: #666;
}

.gps-button:hover svg {
    color: var(--primary-color);
}

.gps-button.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.gps-button.active svg {
    color: white;
}

/* === Reload Button === */
.reload-button {
    position: absolute;
    top: 80px;
    right: 85px;
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--shadow-strong);
    z-index: 1001;
    font-size: 1.25rem;
    transition: all 0.2s;
}

.reload-button:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: rotate(180deg);
}

.reload-button:active {
    transform: scale(0.95) rotate(180deg);
}

.reload-button.loading {
    animation: spin 1s linear infinite;
    pointer-events: none;
    opacity: 0.6;
}

/* === Footer === */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 10px;
    color: var(--text-secondary);
    z-index: 999;
}

.app-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.app-footer a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.app-footer span {
    color: var(--border);
}

/* === Install Prompt === */
.install-prompt {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #cc0000 0%, #aa0000 100%);
    padding: 20px 24px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(204, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    max-width: 360px;
    z-index: 1500;
    animation: slideInRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.install-prompt.slide-out {
    animation: slideOutRight 0.3s ease forwards;
}

.install-prompt::before {
    content: "📱";
    font-size: 28px;
    position: absolute;
    top: -14px;
    left: 20px;
    background: linear-gradient(135deg, #cc0000 0%, #aa0000 100%);
    border-radius: 10px;
    padding: 6px 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.2);
    line-height: 1;
}

.install-prompt p {
    margin: 20px 0 0 0;
    padding-top: 4px;
    font-weight: 600;
    font-size: 16px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    line-height: 1.4;
}

.install-prompt .install-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 4px;
}

.install-prompt button {
    margin: 0;
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.install-prompt #installButton {
    background: white;
    color: #cc0000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.install-prompt #installButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: #f5f5f5;
}

.install-prompt #installButton:active {
    transform: translateY(0);
}

.install-prompt #dismissInstall {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.install-prompt #dismissInstall:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.install-prompt #dismissInstall:active {
    background: rgba(255, 255, 255, 0.15);
}

/* === Buttons === */
.btn-primary,
.btn-secondary,
.btn-text {
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-text {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
}

.btn-text:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* === Modal === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 32px var(--shadow-strong);
    z-index: 2;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--surface);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--border);
}

.modal-close:active {
    transform: scale(0.95);
}

.modal-content h2 {
    margin-bottom: 16px;
    color: var(--primary-color);
}

.modal-content h3 {
    margin: 16px 0 8px 0;
    font-size: 1.1rem;
}

.modal-content ul {
    list-style-position: inside;
    margin: 8px 0;
    line-height: 1.8;
}

.modal-content p {
    line-height: 1.6;
    margin-bottom: 12px;
}

.version {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 16px;
}

.modal-links {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.modal-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.modal-links a:hover {
    text-decoration: underline;
}

/* === Debug Info === */
.debug-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border);
}

.debug-info h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
    color: var(--warning);
}

.debug-info h4 {
    margin-bottom: 8px;
    font-size: 1rem;
    color: var(--text-primary);
}

.debug-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.debug-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: var(--surface);
    border-radius: 6px;
    font-size: 0.9rem;
}

.debug-item strong {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.debug-item span {
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* === Legal Modal === */
.legal-modal {
    max-width: 700px;
    padding: 32px;
}

.legal-modal h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.legal-modal h3 {
    margin-top: 24px;
    margin-bottom: 12px;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.legal-modal h4 {
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.legal-modal p {
    line-height: 1.8;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.legal-modal em {
    display: block;
    padding: 12px;
    background: var(--surface);
    border-left: 3px solid var(--primary-color);
    margin-bottom: 20px;
    font-style: normal;
}

.legal-modal ul {
    margin: 12px 0 16px 0;
    padding-left: 20px;
    line-height: 1.8;
}

.legal-modal li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.legal-modal small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* === Leaflet Popup === */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    min-width: 320px;
}

.leaflet-popup-content {
    margin: 12px;
    max-width: 400px;
}

.leaflet-popup-content h3 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
}

.hydrant-popup {
    text-align: center;
}

.hydrant-popup .popup-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
}

.hydrant-popup .popup-photos img {
    flex: 1 1 calc(50% - 4px);
    min-width: 150px;
    max-width: 200px;
}

.hydrant-popup img {
    width: 100%;
    max-width: 350px;
    border-radius: 4px;
    margin: 12px 0;
    cursor: zoom-in;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.hydrant-popup img:hover {
    transform: scale(1.05);
}

.hydrant-popup p {
    margin: 4px 0;
    color: var(--text-secondary);
}

.hydrant-popup strong {
    color: var(--text-primary);
}

/* === Photo Overlay === */
.photo-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    padding: 20px;
    -webkit-tap-highlight-color: transparent;
}

.photo-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-overlay .photo-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.photo-overlay img {
    width: 95%;
    max-width: 95%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
    object-fit: contain;
    will-change: transform;
    transform-origin: center center;
}

.photo-overlay img:active {
    cursor: grabbing;
}

/* Nur beim initialen Laden animieren */
#zoomablePhoto {
    transition: none !important;
}

.photo-overlay-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.photo-overlay-close:hover {
    background: white;
    transform: scale(1.1);
}

.photo-overlay-close:active {
    transform: scale(0.95);
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* === Leaflet Attribution === */
.leaflet-control-attribution {
    margin-bottom: 0px !important;
    background: rgba(255, 255, 255, 0.8) !important;
    font-size: 10px !important;
}

.leaflet-bottom {
    bottom: 35px !important;
}

/* === Mobile Responsive === */
@media (max-width: 600px) {
    .legend {
        top: auto;
        bottom: 40px; 
        right: auto;
        left: 10px;
        max-width: 180px;
    }
    
    .legend-toggle {
        font-size: 0.7rem;
        padding: 6px 10px;
    }
    
    .legend-item {
        font-size: 0.65rem;
    }
    
    .gps-button {
        bottom: 85px; 
        right: 10px;
    }
    
    .reload-button {
        top: 60px;
    }
    
    .cookie-buttons {
        flex-direction: column;
    }
    
    .cookie-buttons button {
        width: 100%;
    }
    
    .install-prompt {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: calc(100% - 40px);
        padding: 20px 18px 16px 18px;
    }

    .install-prompt::before {
        font-size: 24px;
        top: -12px;
        left: 16px;
        padding: 5px 8px;
    }

    .install-prompt p {
        font-size: 15px;
        margin: 16px 0 0 0;
    }

    .install-prompt .install-actions {
        flex-direction: column;
    }

    .install-prompt button {
        width: 100%;
    }
    
    .modal-content {
        max-width: 100%;
        padding: 20px;
    }
}

/* === Mobile Responsive - Leaflet === */
@media (max-width: 600px) {
    .leaflet-popup-content-wrapper {
        min-width: 280px;
    }
    
    .hydrant-popup img {
        max-width: 100%;
    }
    
    .leaflet-control-attribution {
        margin-bottom: 0px !important;
        font-size: 9px !important;
        max-width: 60%;
    }
    
    .leaflet-control-scale {
        margin-bottom: 35px !important;
    }
    
    .leaflet-top .leaflet-control {
        margin-top: 60px !important;
    }
}

/* === Tablet Responsive === */
@media (min-width: 601px) and (max-width: 1024px) {
    .legend {
        top: 130px;
    }
    
    .reload-button {
        top: 65px;
    }
}

/* === Print === */
@media print {
    .app-header,
    .legend,
    .install-prompt,
    .offline-notice,
    .reload-button,
    .gps-button,
    .app-footer {
        display: none !important;
    }
    
    .map-container {
        margin-bottom: 0;
    }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === High Contrast Mode === */
@media (prefers-contrast: high) {
    .legend,
    .gps-button,
    .reload-button {
        border: 3px solid var(--text-primary);
    }
    
    .btn-primary,
    .btn-secondary {
        border: 2px solid var(--text-primary);
    }
}

/* === Focus Styles for Accessibility === */
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* === Custom Scrollbar === */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--surface);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* === Back to Top Button === */
.back-to-top {
    position: fixed;
    bottom: 45px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.2);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--shadow-strong);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s ease;
    transform: translateY(100px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-5px) scale(1.1);
}

.back-to-top:active {
    transform: translateY(0) scale(0.95);
}

@media (max-width: 600px) {
    .back-to-top {
        bottom: 45px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}
