/**
 * FTP Gallery Sync - Public Styles
 *
 * @package FTP_Gallery_Sync
 * @since   2.0.0
 */

/* Login Form */
.ftp-gallery-login {
    max-width: 400px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ftp-gallery-login label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.ftp-gallery-login input[type="text"],
.ftp-gallery-login input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.ftp-gallery-login input[type="text"]:focus,
.ftp-gallery-login input[type="password"]:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.ftp-gallery-login button {
    width: 100%;
    padding: 12px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ftp-gallery-login button:hover {
    background: #005f8d;
}

/* Gallery Selector */
.ftp-gallery-selector {
    max-width: 800px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.ftp-gallery-selector h2 {
    margin-top: 0;
    color: #333;
}

.ftp-gallery-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.ftp-gallery-list form {
    margin: 0;
}

.ftp-gallery-list button {
    padding: 15px 30px;
    font-size: 16px;
    background: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ftp-gallery-list button:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Gallery Container */
.ftp-gallery-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Gallery Heading */
.ftp-gallery-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.ftp-gallery-heading h3 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.ftp-gallery-qr img {
    max-width: 100px;
    height: auto;
}

/* Masonry Gallery */
.ftp-gallery {
    width: 100%;
}

.ftp-gallery-item {
    break-inside: avoid;
    margin-bottom: 8px;
    width: 32%;
    margin-left: 1%;
}

.ftp-gallery-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ftp-gallery-item a {
    display: block;
}

.ftp-gallery-item a:hover .ftp-gallery-img {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Message Styles */
.ftp-gallery-message {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 8px;
    color: #666;
}

.ftp-gallery-message.error {
    background: #fff0f0;
    color: #d63638;
}

/* QR Code Shortcode */
.ftp-qr-code {
    display: inline-block;
}

.ftp-qr-code img {
    max-width: 150px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .ftp-gallery-item {
        width: 49%;
        margin-left: 1%;
    }

    .ftp-gallery-heading {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .ftp-gallery-login {
        margin: 10px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .ftp-gallery-item {
        width: 100%;
        margin-left: 0;
    }

    .ftp-gallery-selector {
        margin: 10px;
        padding: 20px;
    }

    .ftp-gallery-list {
        flex-direction: column;
    }

    .ftp-gallery-list button {
        width: 100%;
    }
}

/* Gallery Toolbar */
.ftp-gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Photo Count */
.ftp-gallery-count {
    color: #666;
    font-size: 14px;
}

.ftp-gallery-filter-count {
    color: #0073aa;
    font-weight: 600;
    margin-left: 5px;
}

/* Search Box */
.ftp-gallery-search {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.ftp-gallery-search-input {
    width: 100%;
    padding: 10px 35px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ftp-gallery-search-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.ftp-gallery-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.ftp-gallery-search-clear:hover {
    color: #333;
}

/* Gallery Actions */
.ftp-gallery-actions {
    display: flex;
    gap: 10px;
}

.ftp-download-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ftp-download-all-btn:hover {
    background: #005f8d;
}

.ftp-download-all-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Individual Download Button */
.ftp-gallery-item {
    position: relative;
}

.ftp-download-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ftp-gallery-item:hover .ftp-download-btn {
    opacity: 1;
}

.ftp-download-btn:hover {
    background: #0073aa;
    color: #fff;
}

.ftp-download-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Load More */
.ftp-gallery-load-more {
    text-align: center;
    padding: 30px 0;
}

.ftp-load-more-btn {
    padding: 15px 40px;
    background: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ftp-load-more-btn:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.ftp-load-more-count {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.ftp-load-more-btn:hover .ftp-load-more-count {
    color: rgba(255, 255, 255, 0.8);
}

.ftp-loading-spinner {
    padding: 20px;
}

.ftp-loading-spinner .dashicons {
    font-size: 30px;
    width: 30px;
    height: 30px;
    color: #0073aa;
}

.ftp-loading-spinner .spinning {
    animation: ftp-spin 1s linear infinite;
}

@keyframes ftp-spin {
    100% { transform: rotate(360deg); }
}

/* Lazy Loading */
.ftp-lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ftp-loaded {
    opacity: 1;
}

.ftp-lazy-gallery .ftp-gallery-item {
    background: #f0f0f0;
    min-height: 200px;
}

/* Fix for site footer */
.ftp-gallery-box + .site-footer,
.ftp-gallery-container + .site-footer {
    margin-top: 100px !important;
}
