/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header and Navigation */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #4361ee;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-left: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.nav-link:hover,
.nav-link.active {
    color: #4361ee;
    background-color: #eef2ff;
}

.auth-section {
    padding: 3rem 2rem;
}

.auth-container {
    max-width: 500px;
    margin: 0 auto;
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.tab {
    flex: 1;
    padding: 1rem;
    border: none;
    background: none;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
}

.tab.active {
    color: #4361ee;
    border-bottom: 3px solid #4361ee;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #4361ee;
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background-color: #4361ee;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.auth-btn:hover {
    background-color: #3a0ca3;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
}

.auth-footer a {
    color: #4361ee;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.guest-message {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.guest-message p {
    font-weight: 500;
    margin-bottom: 1rem;
}

.guest-message ul {
    text-align: left;
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.guest-message li {
    margin-bottom: 0.5rem;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    padding: 5rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    color: white;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    display: inline-block;
    background-color: #fff;
    color: #4361ee;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 2px solid #fff;
}

.cta-button:hover {
    background-color: transparent;
    color: #fff;
}

/* Features Section */
.features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 2rem;
}

.feature {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
    text-align: center;
    padding: 2rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-10px);
}

.feature h3 {
    margin-bottom: 1rem;
    color: #4361ee;
}

/* Upload Section */
.upload-section {
    padding: 3rem 2rem;
}

.upload-section h1 {
    text-align: center;
    margin-bottom: 1rem;
    color: #333;
}

.upload-section > p {
    text-align: center;
    margin-bottom: 2rem;
    color: #666;
}

.upload-form {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.drop-area {
    border: 2px dashed #4361ee;
    border-radius: 10px;
    padding: 3rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.drop-area:hover,
.drop-area.dragover {
    background-color: #eef2ff;
}

.url-upload {
    margin: 1.5rem 0;
    text-align: center;
}

.url-upload p {
    margin-bottom: 0.5rem;
    color: #666;
}

#url-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
}

.load-url-btn {
    background-color: #4cc9f0;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.load-url-btn:hover {
    background-color: #4895ef;
}

.hotlink-protection {
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

.toggle-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.toggle-container input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 12px;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.toggle-container input:checked + .toggle-slider {
    background-color: #4361ee;
}

.toggle-container input:checked + .toggle-slider::before {
    transform: translateX(26px);
}

.hotlink-info {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0.5rem 0 0 0;
    padding: 0;
    line-height: 1.4;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #eee;
    border-radius: 10px;
    margin: 1rem 0;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background-color: #4361ee;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    font-weight: bold;
}

.error {
    color: #f72585;
    background-color: #ffebee;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #f72585;
    margin: 10px 0;
}

.drop-area p {
    margin-bottom: 1rem;
    color: #666;
}

.browse-btn {
    background-color: #4361ee;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.browse-btn:hover {
    background-color: #3a0ca3;
}

.preview {
    margin: 1rem 0;
    text-align: center;
}

.preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 5px;
}

.upload-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #4361ee;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.upload-btn:hover:not(:disabled) {
    background-color: #3a0ca3;
}

.upload-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.result {
    text-align: center;
    padding: 2rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.url-box {
    display: flex;
    margin: 1rem 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.url-box span {
    flex: 1;
    padding: 10px;
    background: #f8f9fa;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn {
    padding: 10px 15px;
    background: #4361ee;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.copy-btn:hover {
    background: #3a0ca3;
}

.copy-btn.copied {
    background: #4CAF50;
}

.copy-btn.small {
    padding: 5px 10px;
    font-size: 0.9rem;
}

.copy-btn.tiny {
    padding: 3px 8px;
    font-size: 0.8rem;
}

.delete-link-container {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px dashed #e9ecef;
}

.delete-label {
    display: block;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.3rem;
}

.links-container {
    margin: 1.5rem 0;
}

.link-item {
    margin-bottom: 1rem;
}

.link-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #4361ee;
}

.link-item .url-box {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.link-item .url-text {
    flex: 1;
    padding: 10px;
    background: #f8f9fa;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: monospace;
    font-size: 0.9rem;
}

.delete-info {
    font-size: 0.8rem;
    color: #f72585;
    margin: 0.3rem 0 0 0;
    font-style: italic;
}

.url-box.small {
    font-size: 0.85rem;
}

.url-text.small {
    font-size: 0.8rem;
    padding: 6px;
}

#uploaded-image {
    max-width: 100%;
    max-height: 300px;
    margin-top: 1rem;
    border-radius: 5px;
}

.hidden {
    display: none;
}

/* My Images Section */
.my-images-section {
    padding: 3rem 2rem;
}

.my-images-section h1 {
    text-align: center;
    margin-bottom: 1rem;
}

.my-images-section > p {
    text-align: center;
    margin-bottom: 2rem;
    color: #666;
}

.filter-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

#search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

#sort-select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.image-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.image-card:hover {
    transform: translateY(-5px);
}

.image-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.image-info {
    padding: 1rem;
}

.image-name {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hotlink-badge {
    display: inline-block;
    background-color: #4361ee;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    margin-bottom: 0.5rem;
}

.image-actions {
    display: flex;
    gap: 0.5rem;
}

.copy-link,
.delete-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.copy-link {
    background: #4361ee;
    color: white;
}

.delete-btn {
    background: #f72585;
    color: white;
}

.no-images {
    text-align: center;
    padding: 3rem;
}

.no-images p {
    margin-bottom: 2rem;
    font-size: 1.2rem;
    color: #666;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background: #fff;
    border-top: 1px solid #eee;
    margin-top: 2rem;
}

footer a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #4361ee;
    text-decoration: underline;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .nav-container {
        padding: 1rem;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: #fff;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-item {
        margin: 1rem 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .hero {
        padding: 3rem 1rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .features {
        padding: 2rem 1rem;
    }
    
    .filter-controls {
        flex-direction: column;
    }
    
    .url-box {
        flex-direction: column;
    }
    
    .url-box span {
        padding: 15px;
    }
}