* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 4rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Auth Section */
#auth-section {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

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

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: #f0f0f0;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1rem;
    transition: background 0.3s;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* Dashboard */
#dashboard-section {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

#username-display {
    font-size: 1.2rem;
    font-weight: 600;
}

.current-wallpaper {
    margin-bottom: 30px;
}

.current-wallpaper h2 {
    margin-bottom: 15px;
    color: #333;
}

#current-wallpaper-display img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    margin-bottom: 10px;
}

#current-wallpaper-url {
    color: #667eea;
    word-break: break-all;
    margin-bottom: 5px;
}

#current-wallpaper-time {
    color: #666;
    font-size: 0.9rem;
}

.upload-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.upload-section h2 {
    margin-bottom: 15px;
    color: #333;
}

.wallpapers-section h2 {
    margin-bottom: 20px;
    color: #333;
}

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

.wallpaper-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    cursor: pointer;
}

.wallpaper-item:hover {
    transform: scale(1.05);
}

.wallpaper-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.wallpaper-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px;
    font-size: 0.8rem;
}

.wallpaper-item button {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
}

/* Message */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    z-index: 1000;
}

.message.success {
    background: #4caf50;
}

.message.error {
    background: #f44336;
}

.hidden {
    display: none !important;
}

/* Download Section */
.download-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f0f4ff;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.download-section h2 {
    margin-bottom: 10px;
    color: #333;
}

.download-section p {
    margin-bottom: 15px;
    color: #666;
}

.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-download {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    width: fit-content;
}

.btn-download:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.download-icon {
    font-size: 2rem;
}

.download-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.download-text strong {
    font-size: 1.1rem;
}

.download-text small {
    color: #666;
    font-size: 0.85rem;
}

.btn-download:hover .download-text small {
    color: #e0e0e0;
}

.download-note {
    padding: 15px;
    background: white;
    border-radius: 5px;
    font-size: 0.9rem;
    color: #555;
}

.download-note code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #667eea;
    font-weight: 600;
}
