/**
 * GwdFeed Frontend CSS
 * Modern Instagram-style design
 */

 :root {
    --gwd-primary: #9e4563;
    --gwd-primary-light: #b15576;
    --gwd-primary-dark: #7d3650;
    --gwd-success: #22c55e;
    --gwd-error: #ef4444;
    --gwd-warning: #f59e0b;
    --gwd-white: #ffffff;
    --gwd-black: #000000;
    --gwd-gray-50: #f9fafb;
    --gwd-gray-100: #f3f4f6;
    --gwd-gray-200: #e5e7eb;
    --gwd-gray-300: #d1d5db;
    --gwd-gray-400: #9ca3af;
    --gwd-gray-500: #6b7280;
    --gwd-gray-600: #4b5563;
    --gwd-gray-700: #374151;
    --gwd-gray-800: #1f2937;
    --gwd-gray-900: #111827;
    --gwd-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --gwd-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --gwd-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --gwd-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --gwd-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/*
 * FIX SPACE GOWEDDY
 */
.gwd-media-feed #textContent {
    padding-bottom: 0 !important;
}
.gwd-media-feed #textContent > div > .btHigh,
.gwd-media-feed .btHigh.postContent {
    margin: 0 !important;
}

/* Container */
#gwd-feed * {
	font-family: Arial, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif!important;
}
.gwd-feed-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
	line-height: 1.4;
	color: var(--gwd-gray-900);
}

/* User Header */
.gwd-user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gwd-white);
    padding: 20px 24px;
    border-radius: 16px;
    box-shadow: var(--gwd-shadow);
    margin-bottom: 24px;
}

.gwd-user-greeting {
    font-size: 18px;
    font-weight: 600;
    color: var(--gwd-gray-900);
}

/* Buttons */
.gwd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    white-space: nowrap;
}

.gwd-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(158, 69, 99, 0.1);
}

.gwd-btn-primary {
    background: var(--gwd-primary);
    color: var(--gwd-white);
}

.gwd-btn-primary:hover {
    background: var(--gwd-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--gwd-shadow-md);
}

.gwd-btn-secondary {
    background: var(--gwd-gray-100);
    color: var(--gwd-gray-700);
}

.gwd-btn-secondary:hover {
    background: var(--gwd-gray-200);
    color: var(--gwd-gray-800);
    transform: translateY(-1px);
}

.gwd-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.welcome-first-upload,
.gwd-auth-submit {
    text-transform: uppercase;
    font-size: 19px;
    line-height: 1;
    padding: 20px 30px;
    border-radius: 5px;
}
.gwd-auth-submit {
    display: block;
    width: 100%;
    text-align: center;
}

.gwd-load-more-btn {
    color: var(--gwd-primary);
    border: 1px solid var(--gwd-primary);
    border-radius: 5px;
    background: transparent;
    text-transform: uppercase;
}

/* Upload Section */
.gwd-upload-section {
    position: relative;
    overflow: hidden;
}

.gwd-upload-form {
    padding: 0;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.gwd-upload-form > * {
    width: 100%;
}

.gwd-caption-input {
    flex: 1;
    padding: 16px;
    border: 2px solid var(--gwd-gray-200);
    border-radius: 12px!important;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s ease;
}

#gwd-feed .gwd-upload-section .gwd-upload-form .gwd-caption-input:focus {
    outline: none;
    border-color: var(--gwd-primary)!important;
    box-shadow: 0 0 0 3px rgba(158, 69, 99, 0.1);
}

.gwd-caption-input::placeholder {
    color: var(--gwd-gray-400);
}
.gwd-upload-form button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 20px 10px;
    text-transform: uppercase;
    border-radius: 5px;
}
.filepond--drop-label {
    cursor: pointer;
}

/* FilePond Customization */
.filepond--root,
.filepond--drop-label.filepond--drop-label label {
    font-family: inherit;
    font-size: 17px!important;
}
.filepond--drop-label.filepond--drop-label label {
    cursor: pointer;
}
.filepond--credits {
    display: none!important;
}

.filepond--drop-label {
    background: linear-gradient(135deg, #fef7f0 0%, var(--gwd-gray-50) 100%);
    border: 2px dashed var(--gwd-primary);
    border-radius: 10px;
    color: var(--gwd-primary);
    font-weight: 500;
    transition: all 0.3s ease;
}

.filepond--drop-label:hover {
    border-color: var(--gwd-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--gwd-shadow-md);
}

.filepond--panel-root {
    border-radius: 16px;
    background: var(--gwd-white);
}

.filepond--item-panel {
    border-radius: 12px;
}

/* Stati di caricamento per l'upload */

/* Spinner per il pulsante di upload */
.upload-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Stato del pulsante durante l'upload */
.gwd-publish-btn.uploading {
    background-color: #6b7280 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Stato della zona di upload durante il caricamento */
.gwd-upload-zone.uploading {
    opacity: 0.6;
    pointer-events: none;
}

.gwd-upload-zone.uploading .filepond--root {
    pointer-events: none;
}

/* Miglioramenti per FilePond durante l'upload */
.gwd-upload-zone.uploading .filepond--panel-root {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.gwd-upload-zone.uploading .filepond--drop-label {
    opacity: 0.5;
}

/* Stato disabilitato per input caption */
.gwd-caption-input:disabled {
    background-color: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

/* Animazioni FilePond native migliorate */
.filepond--root {
    transition: all 0.3s ease;
}

.filepond--item {
    transition: all 0.2s ease;
}

/* Stato di caricamento FilePond personalizzato */
.filepond--item-panel[data-load-state="loading"] {
    background-color: #f0f9ff !important;
}

.filepond--item-panel[data-load-state="loading"] .filepond--item-panel-bottom {
    background-color: #dbeafe !important;
}

/* Indicatore di progresso personalizzato */
.filepond--item[data-file-state="loading"] .filepond--progress-indicator {
    background-color: #3b82f6 !important;
}

/* Overlay di caricamento per l'intera sezione upload */
.gwd-upload-section.uploading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    z-index: 10;
    pointer-events: none;
}

.gwd-upload-section {
    position: relative;
}

/* Feedback visivo migliorato */
.gwd-publish-btn {
    transition: all 0.2s ease;
    min-width: 120px; /* Evita che il pulsante cambi dimensione */
}

.gwd-publish-btn:not(.uploading):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.gwd-publish-btn:disabled {
    transform: none;
    box-shadow: none;
}

/* Stato del form durante upload */
.gwd-upload-form.uploading {
    opacity: 0.7;
    pointer-events: none;
}

/* Miglioramenti responsive */
@media (max-width: 768px) {
    .upload-spinner {
        width: 14px;
        height: 14px;
        margin-right: 6px;
    }
    
    .gwd-publish-btn {
        min-width: 100px;
    }
}

/* Controls */
.gwd-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gwd-filter-select {
    padding: 12px 16px;
    border: 1px solid var(--gwd-gray-200);
    border-radius: 5px!important;
    font-size: 14px!important;
    font-weight: 500!important;
    color: var(--gwd-gray-700)!important;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.gwd-filter-select:focus {
    outline: none;
    border-color: var(--gwd-primary);
}

.gwd-wrapper-action {
    display: flex;
    gap: 15px;
}

.gwd-view-toggle {
    display: flex;
    background: var(--gwd-gray-100);
    border-radius: 12px;
    padding: 4px;
    gap: 5px;
}

.gwd-toggle-btn {
    padding: 7px 16px;
    border: none;
    text-transform: uppercase;
    background: transparent;
    color: var(--gwd-gray-600);
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.gwd-toggle-btn.active {
    background: var(--gwd-primary);
    color: var(--gwd-white);
    box-shadow: var(--gwd-shadow-sm);
}

.gwd-toggle-btn:hover:not(.active) {
    background: var(--gwd-gray-200);
    color: var(--gwd-gray-800);
}

/* Feed Grid */
.gwd-feed-wrapper {
    margin-bottom: 32px;
}

.gwd-feed-loading {
    text-align: center;
    padding: 60px 20px;
}

.gwd-feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 32px;
}

/* Responsive Grid */
.gwd-feed-container[data-columns="2"] .gwd-feed-grid {
    grid-template-columns: repeat(2, 1fr);
}

.gwd-feed-container[data-columns="3"] .gwd-feed-grid {
    grid-template-columns: repeat(3, 1fr);
}

.gwd-feed-container[data-columns="4"] .gwd-feed-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* Media Items */
.gwd-media-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--gwd-shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--gwd-gray-100);
}

.gwd-media-item:hover {
    box-shadow: var(--gwd-shadow-xl);
}

.gwd-media-item img,
.gwd-media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gwd-media-item:hover img,
.gwd-media-item:hover video {
    transform: scale(1.05);
}

/* Video Overlay */
.gwd-video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: var(--gwd-white);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 5;
    backdrop-filter: blur(10px);
}
.gwd-media-item:hover .gwd-video-overlay {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}
.gwd-video-overlay svg {
    width: 24px;
    height: 24px;
    color: var(--gwd-white);
}

/* Media Overlay */
.gwd-media-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    transition: opacity 0.3s ease;
}

.gwd-like-btn {
    align-self: flex-end;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 7px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    line-height: 1;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
}

.gwd-like-btn:hover {
    background: var(--gwd-white);
    transform: scale(1.05);
}

.gwd-like-btn.gwd-liked {
    background: var(--gwd-primary);
    color: var(--gwd-white);
}

.gwd-like-btn.gwd-liked:hover {
    background: var(--gwd-primary-dark);
}

.gwd-like-btn.gwd-processing {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.gwd-like-btn.gwd-processing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

span.gwd-heart {
    display: flex
;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
    75% { transform: scale(1.25); }
    100% { transform: scale(1.2); }
}

.gwd-media-info {
    color: var(--gwd-white);
}

.gwd-author {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    display: block;
    line-height: 1;
}

.gwd-caption {
    font-size: 14px!important;
    line-height: 1.4!important;
    margin: 0!important;
    opacity: 0.9!important;
    display: -webkit-box!important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Empty States */
.gwd-feed-empty {
    text-align: center;
    padding: 80px 20px;
}

.gwd-empty-state {
    max-width: 400px;
    margin: 0 auto;
}

.gwd-empty-icon {
    font-size: 80px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.gwd-empty-state h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--gwd-gray-900);
    margin-bottom: 12px;
}

.gwd-empty-state p {
    color: var(--gwd-gray-600);
    font-size: 16px;
    margin-bottom: 24px;
}

.gwd-no-media {
    text-align: center;
    padding: 60px 20px;
    color: var(--gwd-gray-500);
    font-size: 16px;
}

/* Load More */
.gwd-load-more-container {
    text-align: center;
    margin-top: 32px;
}

/* Auth Popup */
.gwd-auth-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(5px);
}

.gwd-auth-modal {
    background: var(--gwd-white);
    border-radius: 10px;
    padding: 32px;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--gwd-shadow-xl);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.gwd-auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.gwd-auth-header-welcome {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.gwd-auth-header-welcome  h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--gwd-gray-900);
}


/* Tabs */
.gwd-auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.gwd-auth-header h3 {
    margin: 0 0 8px 0;
    color: var(--gwd-primary);
    font-size: 24px;
    font-weight: 600;
}

.gwd-auth-header p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

/* Forms */
.gwd-auth-form {
    display: block;
}

.gwd-auth-form.hidden {
    display: none;
}

.gwd-form-group {
    margin-bottom: 20px;
}

.gwd-input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--gwd-gray-200);
    border-radius: 5px!important;
    min-height: 50px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.gwd-input:focus {
    outline: none;
    border-color: var(--gwd-primary);
    box-shadow: 0 0 0 3px rgba(158, 69, 99, 0.1);
}

.gwd-input::placeholder {
    color: var(--gwd-gray-400);
}

.gwd-auth-loading {
    text-align: center;
    padding: 40px 20px;
}

.gwd-auth-loading.hidden {
    display: none;
}
.gwd-auth-note {
    font-size: 14px !important;
    color: #666;
    text-align: center;
    margin: 15px 0 0 !important;
    line-height: 1.4;
}

/* Field help text */
.gwd-field-help {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    line-height: 1.3;
}

/* Error state for inputs */
.gwd-input.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2);
}

/* Auth message container */
.gwd-auth-message {
    margin: 15px 0;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.gwd-auth-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.gwd-auth-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.gwd-auth-message.warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.gwd-auth-message.info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.gwd-message-text {
    margin: 0 !important;
    text-align: center;
    font-size: 16px !important;
}

/* Modal */
.gwd-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.gwd-modal-container {
    background: var(--gwd-white);
    border-radius: 20px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--gwd-shadow-xl);
    display: flex;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

.gwd-modal-close,
.gwd-close-popup {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: var(--gwd-white);
    display: flex;
    padding: 0;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}
.gwd-modal-close:hover,
.gwd-close-popup:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}
.gwd-modal-close svg,
.gwd-close-popup svg {
    width: 25px;
    height: 25px;
}

.gwd-modal-content {
    display: flex;
    width: 100%;
}

.gwd-modal-media {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gwd-black);
    min-height: 400px;
}

.gwd-media-container {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gwd-media-container img,
.gwd-media-container video {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.gwd-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    padding: 0;
    justify-content: center;
    align-items: center;    color: var(--gwd-white);
    border: 1px solid var(--gwd-white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 99;
}
.gwd-nav-btn svg {
    width: 25px;
    height: 25px;
}

.gwd-nav-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.gwd-nav-prev {
    left: 20px;
}

.gwd-nav-next {
    right: 20px;
}

.gwd-modal-sidebar {
    width: 350px;
    padding: 32px;
    background: var(--gwd-white);
    display: flex;
    flex-direction: column;
}

.gwd-modal-header {
    margin-bottom: 20px;
}

.gwd-modal-author {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--gwd-gray-900);
}

.gwd-modal-date {
    color: var(--gwd-gray-500);
    font-size: 14px;
}

.gwd-modal-caption {
    flex: 1;
    color: var(--gwd-gray-700);
    line-height: 1.6;
    margin-bottom: 24px;
}

.gwd-modal-actions {
    border-top: 1px solid var(--gwd-gray-100);
    padding-top: 20px;
}

.gwd-modal-like-btn {
    background: var(--gwd-gray-100);
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--gwd-gray-700);
}

.gwd-modal-like-btn:hover {
    background: var(--gwd-gray-200);
    transform: scale(1.05);
}

.gwd-modal-like-btn.gwd-liked {
    background: var(--gwd-primary);
    color: var(--gwd-white);
}

.gwd-modal-content .gwd-modal-like-btn {
    position: absolute;
    left: 20px;
    top: 20px;
    background: rgba(0, 0, 0, 0.4)!important;
    color: #fff;
    padding: 7px 10px;
    border-radius: 5px;
}

.gwd-modal-like-btn.gwd-liked:hover {
    background: var(--gwd-primary-dark);
}

/* Toast */
.gwd-toast {
    position: fixed;
    top: 20px;
    right: -10px;
    background: var(--gwd-gray-900);
    color: var(--gwd-white);
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: var(--gwd-shadow-xl);
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.gwd-toast.show {
    transform: translate(-20px, 20px);
}

.gwd-toast.success {
    background: var(--gwd-success);
}

.gwd-toast.error {
    background: var(--gwd-error);
}

/* Spinner */
.gwd-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gwd-gray-200);
    border-top: 4px solid var(--gwd-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Modal open state - prevent body scroll - GESTITO DA JAVASCRIPT */
/* body.gwd-modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
} */

/* Responsive Design */
@media (max-width: 768px) {
    .gwd-feed-container {
        padding: 50px 15px;
    }
    
    .gwd-feed-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .gwd-feed-container[data-columns="2"] .gwd-feed-grid,
    .gwd-feed-container[data-columns="3"] .gwd-feed-grid,
    .gwd-feed-container[data-columns="4"] .gwd-feed-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gwd-controls {
        flex-direction: column;
        gap: 16px;
    }

    .gwd-media-container img, .gwd-media-container video {
        max-height: 55vh;
    }
    
    .gwd-upload-form {
        flex-direction: column;
    }
    
    .gwd-user-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    .gwd-modal-content {
        flex-direction: column;
    }

    .gwd-modal-container {
        flex-direction: column;
        width: 100vw;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height per dispositivi moderni */
        border-radius: 0;
        max-width: none;
        max-height: none;
    }
    
    /* Fix per i pulsanti del modale su mobile */
    .gwd-modal-close {
        top: max(20px, env(safe-area-inset-top, 20px));
        right: max(20px, env(safe-area-inset-right, 20px));
        width: 40px;
        height: 40px;
        background: rgba(0, 0, 0, 0.7);
        z-index: 1001;
    }
    
    .gwd-modal-content .gwd-modal-like-btn {
        top: max(20px, env(safe-area-inset-top, 20px));
        left: max(20px, env(safe-area-inset-left, 20px));
        z-index: 1001;
        padding: 10px 12px;
        font-size: 14px;
    }
    
    /* Assicura che i pulsanti di navigazione siano visibili */
    .gwd-nav-btn {
        width: 40px;
        height: 40px;
        z-index: 1000;
    }
    
    .gwd-nav-prev {
        left: max(15px, env(safe-area-inset-left, 15px));
    }
    
    .gwd-nav-next {
        right: max(15px, env(safe-area-inset-right, 15px));
    }
    
    .gwd-modal-sidebar {
        width: 100%;
        max-height: 40vh;
        overflow-y: auto;
        padding: max(20px, env(safe-area-inset-bottom, 20px)) 20px 20px 20px;
    }
    
    .gwd-modal-media {
        min-height: 60vh;
        padding-top: max(60px, calc(env(safe-area-inset-top, 20px) + 60px));
    }
    
    .gwd-auth-modal {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .gwd-toast {
        top: 0;
        right: 10px;
        left: 10px;
        transform: translateY(-100%);
    }
    
    .gwd-toast.show {
        transform: translateY(0);
    }
}

/* Supporto aggiuntivo per dispositivi con notch */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .gwd-modal-container {
            padding-top: env(safe-area-inset-top);
            padding-bottom: env(safe-area-inset-bottom);
            padding-left: env(safe-area-inset-left);
            padding-right: env(safe-area-inset-right);
        }
    }
}

@media (max-width: 480px) {
    .gwd-auth-header-welcome .welcome-first-upload {
        font-size: 14px;
        padding: 15px;
    }

}

/* Scroll Lock */
body.gwd-scroll-locked {
    overflow: hidden !important;
    position: relative !important;
    height: 100% !important;
    width: 100% !important;
}
