/* Reset và Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo i {
    font-size: 3rem;
    color: #fff;
    text-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.main-content {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* Upload Section */
.upload-section {
    margin-bottom: 40px;
}

.upload-container {
    position: relative;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.upload-area:hover::before {
    left: 100%;
}

.upload-area:hover {
    border-color: #764ba2;
    background: linear-gradient(135deg, #f0f2ff 0%, #e8f0ff 100%);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.2);
}

.upload-area.dragover {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    transform: scale(1.02);
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    margin-bottom: 25px;
}

.upload-icon i {
    font-size: 4rem;
    color: #667eea;
    transition: all 0.3s ease;
}

.upload-area:hover .upload-icon i {
    color: #764ba2;
    transform: scale(1.1);
}

.upload-area h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.upload-area p {
    margin: 15px 0;
    color: #666;
    font-size: 1.1rem;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.upload-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.upload-info {
    margin-top: 25px;
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.upload-info p {
    color: #667eea;
    font-size: 0.9rem;
    margin: 0;
}

.upload-info i {
    margin-right: 8px;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.section-header h2 {
    font-size: 1.5rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: #667eea;
}

.gallery-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.gallery-stats {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.refresh-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.refresh-btn:active {
    transform: scale(0.95);
}

.refresh-btn i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.refresh-btn:hover i {
    transform: rotate(180deg);
}

/* Images Grid */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.image-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.image-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.image-preview {
    position: relative;
    height: 200px;
    overflow: hidden;
    cursor: pointer;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-card:hover .image-preview img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-preview:hover .image-overlay {
    opacity: 1;
}

.preview-icon {
    color: white;
    font-size: 2rem;
}

.image-info {
    padding: 20px;
}

.image-name {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    word-break: break-word;
}

.image-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.image-size {
    color: #666;
    font-size: 0.9rem;
}

.image-status {
    background: #4CAF50;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.new-filename {
    background: #f0f2ff;
    color: #667eea;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    border-left: 3px solid #667eea;
    margin-top: 10px;
}

/* Image Actions */
.image-actions {
    margin-top: 15px;
    display: flex;
    justify-content: center;
}

.copy-link-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.copy-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.copy-link-btn.copied {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    transform: scale(1.05);
}

.copy-link-btn i {
    font-size: 0.9rem;
}

/* Links Section */
.links-section {
    margin-top: 40px;
}

.copy-all-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.copy-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.links-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.link-item {
    background: #f8f9ff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.link-item:hover {
    background: #f0f2ff;
    border-color: #667eea;
    transform: translateX(5px);
}

.link-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    font-family: 'Courier New', monospace;
}

.copy-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.copy-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.copy-btn.copied {
    background: #4CAF50;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    padding: 20px 0;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #667eea;
}

.loading-spinner p {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: #4CAF50;
}

.toast.error {
    background: #f44336;
}

.toast i {
    font-size: 1.2rem;
}

/* Modal Styles */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    cursor: pointer;
}

.modal-content {
    position: relative;
    margin: 2% auto;
    padding: 30px;
    width: 90%;
    max-width: 900px;
    background: white;
    border-radius: 20px;
    cursor: default;
    max-height: 90vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2rem;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    z-index: 1001;
    background: none;
    border: none;
}

.close-btn:hover {
    color: #000;
}

.modal-content img {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 15px;
    margin-bottom: 20px;
}

.modal-info {
    background: #f8f9ff;
    padding: 20px;
    border-radius: 15px;
    border-left: 5px solid #667eea;
}

.modal-info h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #333;
}

.modal-info p {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 8px;
}

/* Modal Link */
.modal-link {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.modal-link-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    font-family: 'Courier New', monospace;
    color: #333;
}

.modal-copy-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.modal-copy-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.modal-copy-btn.copied {
    background: #4CAF50;
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .header-content {
        padding: 30px 15px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .gallery-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }
    
    .refresh-btn {
        width: 100%;
        justify-content: center;
    }
    
    .link-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
    }
    
    .modal-link {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-copy-btn {
        width: 100%;
        justify-content: center;
    }
    
    .toast {
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .images-grid {
        grid-template-columns: 1fr;
    }
    
    .upload-area h3 {
        font-size: 1.4rem;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
}
