/* Social Gallery Styles */

/* Global button touch optimization for mobile */
button, .btn, .filter-btn, .create-post-btn, .modal-close, .comment-like-btn, .save-btn, .nav-button, .cta-button, .album-card, .post-card {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(8,125,243,0.1);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

button, .btn, .filter-btn, .create-post-btn, .modal-close, .comment-like-btn, .save-btn, .nav-button, .cta-button {
    min-height: 44px;
    min-width: 44px;
}

.gallery-main {
    padding-top: 80px;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(8,125,243,0.05) 0%, rgba(255,255,255,1) 100%);
}

.gallery-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #087df3 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
    margin-bottom: 40px;
}

.hero-content h1 {
    font-size: 3rem;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 30px auto 40px;
    max-width: 900px;
    flex-wrap: wrap;
    padding: 0 20px;
}

.filter-btn {
    padding: 10px 24px;
    border: 2px solid rgba(8,125,243,0.2);
    background: white;
    color: var(--primary-color);
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(8,125,243,0.3);
}

.gallery-posts {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.albums-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.albums-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.albums-header h3 {
    font-size: 1.8rem;
    color: var(--text-color);
    margin: 0;
}

.create-album-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.create-album-btn:hover {
    background: #0766c1;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(8,125,243,0.3);
}

.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.album-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(8,125,243,0.15);
}

.album-cover {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), #0766c1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-info {
    padding: 20px;
}

.album-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.album-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.loading-spinner {
    text-align: center;
    padding: 60px 20px;
    color: var(--primary-color);
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 20px;
}

.post-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(8,125,243,0.15);
}

.post-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.post-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-color);
}

.post-date {
    font-size: 0.9rem;
    color: #666;
    margin-left: auto;
}

.post-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 15px 0 10px;
    color: var(--text-color);
}

.post-description {
    color: #555;
    line-height: 1.6;
    margin: 10px 0;
}

.post-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.post-image:hover {
    opacity: 0.9;
}

.post-image.loading {
    opacity: 0.5;
    background: #f0f0f0;
}

.post-image.error {
    display: none;
}

.post-footer {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-top: 1px solid #eee;
}

.interaction-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    transition: color 0.3s ease;
    padding: 8px 12px;
    border-radius: 8px;
}

.interaction-btn:hover {
    color: var(--primary-color);
    background: rgba(8,125,243,0.05);
}

.interaction-btn.liked {
    color: #e74c3c;
}

.interaction-btn.liked:hover {
    color: #c0392b;
}

.create-post-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(8,125,243,0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.create-post-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(8,125,243,0.5);
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    pointer-events: auto;
}

.modal-overlay.active {
    display: flex;
    pointer-events: auto;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    animation: modalSlideIn 0.3s ease;
    touch-action: pan-y;
    pointer-events: auto;
    z-index: 1001;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--primary-color);
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: 2px solid rgba(8,125,243,0.2);
    background: white;
    color: var(--primary-color);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.auth-tab.active {
    background: var(--primary-color);
    color: white;
}

.auth-form h2 {
    color: var(--text-color);
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(8,125,243,0.2);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    background: #0766c1;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(8,125,243,0.3);
}

.logout-btn {
    padding: 8px 16px;
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #e74c3c;
    color: white;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
}

#user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.no-posts,
.error {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 1.1rem;
}

.post-body {
    padding: 20px;
}

.notification {
    position: fixed;
    top: 100px;
    right: 30px;
    padding: 15px 25px;
    color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 10000;
    animation: slideInFromRight 0.3s ease;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.image-upload-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upload-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border: 2px solid rgba(8,125,243,0.2);
    border-radius: 10px;
    transition: border-color 0.3s ease;
}

.upload-option:hover {
    border-color: var(--primary-color);
}

.upload-option input[type="radio"] {
    margin: 0;
}

.upload-option label {
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}

.url-input, .file-input {
    flex: 1;
    margin: 0;
}

.comments-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 10px;
}

.comment-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 10px;
}

.comment-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.comment-user {
    font-weight: 600;
    color: var(--text-color);
}

.comment-date {
    font-size: 0.8rem;
    color: #666;
}

.comment-content {
    color: #555;
    line-height: 1.4;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.comment-like-btn,
.comment-reply-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: #666;
    transition: color 0.3s ease;
    padding: 5px 10px;
    border-radius: 5px;
}

.comment-like-btn:hover,
.comment-reply-btn:hover {
    background: rgba(8,125,243,0.05);
    color: var(--primary-color);
}

.comment-like-btn.liked {
    color: #e74c3c;
}

.comment-like-btn.liked i {
    color: #e74c3c;
}

.replies-container {
    margin-top: 15px;
    padding-left: 20px;
    border-left: 2px solid #ddd;
}

.reply-comment {
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.parent-comment {
    margin-bottom: 20px;
}

.comment-form {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.post-comments-preview {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    max-height: 200px;
    overflow-y: auto;
}

.comment-preview-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: flex-start;
}

.comment-preview-text {
    flex: 1;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
}

.comment-preview-user {
    font-weight: 600;
    color: var(--text-color);
    margin-right: 5px;
}

.post-add-comment {
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

.inline-comment-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.inline-comment-form input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 0.9rem;
}

.inline-comment-form input:focus {
    border-color: var(--primary-color);
}

.inline-comment-form button {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.inline-comment-form button:hover {
    background: #0766c1;
}

.inline-comment-form button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Image Upload Options */
.image-upload-options {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.upload-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-option:hover {
    border-color: var(--primary-color);
    background: #f8f9fa;
}

.upload-option input[type="radio"] {
    margin: 0;
}

.upload-option input[type="radio"]:checked + label {
    color: var(--primary-color);
    font-weight: 600;
}

.upload-option:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: #e3f2fd;
}

.url-input, .file-input {
    margin-top: 15px;
}

.file-input input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
}

.file-input input[type="file"]:hover {
    border-color: var(--primary-color);
    background: #e3f2fd;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-main {
        padding-top: 60px;
    }
    
    .gallery-hero {
        padding: 50px 15px;
        margin-bottom: 20px;
    }
    
    .hero-content h1 {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
        padding: 0 10px;
    }

    .hero-content p {
        font-size: clamp(0.95rem, 3vw, 1.1rem);
        padding: 0 10px;
    }

    .gallery-filters {
        gap: 0.5rem;
        padding: 0 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        flex-wrap: nowrap;
        margin: 20px auto 30px;
    }
    
    .gallery-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        white-space: nowrap;
        flex-shrink: 0;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(8,125,243,0.2);
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
    }

    .modal-content {
        padding: 25px 15px;
        margin: 10px;
        max-width: calc(100% - 20px);
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-close {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        font-size: 24px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .create-post-btn {
        width: 56px;
        height: 56px;
        min-width: 56px;
        min-height: 56px;
        bottom: 20px;
        right: 20px;
        font-size: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .gallery-posts {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 15px;
    }
    
    .post-card {
        width: 100%;
        margin: 0;
    }

    .albums-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .album-card {
        width: 100%;
    }

    .albums-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        padding: 0 10px;
    }

    .albums-header h3 {
        text-align: center;
        font-size: 1.5rem;
    }
    
    /* Prevent iOS zoom on input focus */
    input, textarea, select {
        font-size: 16px !important;
        -webkit-appearance: none;
        border-radius: 8px;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Make sure all interactive elements are visible and touchable */
    button, a, input, textarea, select {
        -webkit-tap-highlight-color: rgba(8,125,243,0.1);
    }
    
    /* Ensure content is visible */
    .gallery-main {
        min-height: 100vh;
        padding-bottom: 100px;
    }
    
    body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    .auth-form {
        width: 100%;
    }
    
    .auth-form h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 14px 15px;
    }
    
    .submit-btn {
        padding: 16px;
        font-size: 1rem;
    }
}

.auth-form {
    width: 100%;
}

.auth-form h2 {
    margin-bottom: 15px;
}

.auth-form p {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(8,125,243,0.2);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    background: #0766c1;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(8,125,243,0.3);
}

.login-error-message {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.login-error-message.show {
    display: block;
}

.post-location {
    font-size: 0.85rem;
    color: #666;
    margin-top: 2px;
}

/* Theme System Styles */
.theme-selector {
    position: relative;
    display: flex;
    align-items: center;
}

.theme-toggle {
    background: transparent;
    border: 2px solid rgba(8,125,243,0.2);
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.theme-toggle i {
    transition: transform 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(180deg);
}

/* Dark theme specific styles */
.theme-dark {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.theme-dark .navbar {
    background: rgba(45, 45, 45, 0.95);
    backdrop-filter: blur(10px);
}

.theme-dark .post-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.theme-dark .modal-content {
    background: var(--card-bg);
    color: var(--text-color);
}

.theme-dark .form-group input,
.theme-dark .form-group textarea,
.theme-dark .form-group select {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

.theme-dark .form-group input:focus,
.theme-dark .form-group textarea:focus,
.theme-dark .form-group select:focus {
    border-color: var(--primary-color);
}

.theme-dark .comments-list {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.theme-dark .comment-item {
    border-bottom-color: var(--border-color);
}

.theme-dark .comment-content {
    color: var(--text-muted);
}

.theme-dark .notification {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

/* Responsive theme toggle */
@media (max-width: 768px) {
    .theme-toggle {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

/* MOBİL PATCH */
@media (max-width: 480px) {
  .gallery-main {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .gallery-grid {
    gap: 10px !important;
    padding: 0 2vw !important;
  }
  .gallery-item {
    width: 90vw !important;
    min-width: 90vw !important;
    max-width: 100vw !important;
  }
  .albums-section, .albums-grid, .album-card {
    padding-left: 2vw !important;
    padding-right: 2vw !important;
    min-width: 0 !important;
  }
  .modal-content, .post-card, .album-card {
    border-radius: 12px !important;
    padding: 12px !important;
  }
  button, .btn, .filter-btn, .create-post-btn, .modal-close, .comment-like-btn, .save-btn, .nav-button, .cta-button {
    min-width: 44px !important;
    min-height: 44px !important;
    font-size: 16px !important;
    border-radius: 10px !important;
  }
  input, textarea, select {
    font-size: 16px !important;
    border-radius: 10px !important;
  }
}
