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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.container {
    max-width: 1400px;
    width: 100%;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

/* Header */
.header {
    background: #2c3e50;
    color: white;
    padding: 20px 30px;
    border-bottom: 3px solid #34495e;
    border-radius: 4px 4px 0 0;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    color: #ecf0f1;
}

/* User Panel */
.user-panel {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.username {
    font-size: 14px;
    font-weight: 500;
    color: #ecf0f1;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
    background: #34495e;
    color: white;
}

.btn:hover {
    background: #4a5f7f;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-large {
    padding: 12px 24px;
    font-size: 15px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

/* Auth Required */
.auth-required {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    margin: 40px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.auth-required h2 {
    font-size: 22px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.auth-required p {
    font-size: 15px;
    color: #666;
    margin-bottom: 25px;
}

.auth-buttons-center {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    padding: 40px 20px;
}

.auth-box-large {
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 480px;
    max-width: 90%;
    border: 1px solid #e0e0e0;
}

.auth-header {
    background: #2c3e50;
    color: white;
    padding: 25px 30px;
    border-radius: 4px 4px 0 0;
}

.auth-header h1 {
    font-size: 24px;
    margin-bottom: 5px;
    font-weight: 600;
}

.auth-header-subtitle {
    font-size: 14px;
    color: #ecf0f1;
    margin: 0;
}

.auth-content {
    padding: 35px;
}

.auth-form {
    margin: 20px 0;
}

.auth-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    font-family: inherit;
}

.auth-input:focus {
    outline: none;
    border-color: #3498db;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 14px;
}

.auth-footer a {
    color: #3498db;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.error-message {
    background: #e74c3c;
    color: white;
    padding: 10px;
    border-radius: 3px;
    margin-bottom: 15px;
    font-size: 14px;
}

.btn-block {
    width: 100%;
    margin-top: 8px;
}

/* Meme Creator */
.meme-creator {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 40px;
    padding: 40px;
    border-bottom: 1px solid #e0e0e0;
}

.creator-panel {
    background: #fafafa;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.meme-preview {
    padding: 20px;
}

.creator-panel h3, .meme-preview h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 13px;
}

.meme-input, .meme-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    font-family: inherit;
}

.meme-input:focus, .meme-select:focus {
    outline: none;
    border-color: #3498db;
}

.template-options {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
}

.radio-option input[type="radio"] {
    cursor: pointer;
}

.file-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
}

.file-hint {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.btn-create {
    width: 100%;
    background: #27ae60;
    color: white;
    margin-top: 8px;
    padding: 10px;
}

.btn-create:hover {
    background: #229954;
}

/* Tips Box */
.tips-box {
    background: #fff;
    padding: 15px;
    border-radius: 3px;
    margin-top: 15px;
    border: 1px solid #e0e0e0;
    font-size: 13px;
}

.tips-box strong {
    color: #333;
    display: block;
    margin-bottom: 8px;
}

.tips-box ul {
    margin-left: 20px;
    line-height: 1.6;
    color: #555;
}

/* Meme Container */
.meme-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
    border: 2px solid #ddd;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f0f0f0;
}

.meme-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Meme Templates */
.meme-drake .meme-image {
    background: #8e44ad;
}

.meme-distracted .meme-image {
    background: #e67e22;
}

.meme-stonks .meme-image {
    background: #16a085;
}

.meme-pikachu .meme-image {
    background: #f39c12;
}

.meme-doge .meme-image {
    background: #e74c3c;
}

.meme-text {
    position: relative;
    z-index: 1;
    color: white;
    font-size: 32px;
    font-weight: 900;
    text-align: center;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000;
    text-transform: uppercase;
    padding: 10px;
    word-wrap: break-word;
    max-width: 100%;
    line-height: 1.1;
    font-family: Impact, 'Arial Black', sans-serif;
}

.meme-text-top {
    margin-top: 10px;
}

.meme-text-bottom {
    margin-bottom: 10px;
}

.meme-container.small {
    max-width: 100%;
}

.meme-container.small .meme-text {
    font-size: 20px;
}

/* Gallery */
.memes-gallery {
    padding: 30px;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.gallery-header h3 {
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.btn-clear {
    background: #95a5a6;
    color: white;
}

.btn-clear:hover {
    background: #7f8c8d;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
    background: #fafafa;
    border: 1px dashed #ddd;
    border-radius: 4px;
}

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

.meme-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.meme-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.meme-info {
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
    border-top: 1px solid #e0e0e0;
}

.meme-author {
    color: #666;
    font-size: 13px;
}

.meme-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-share {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    transition: transform 0.2s;
}

.btn-share:hover {
    transform: scale(1.2);
}

.btn-delete {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    color: #e74c3c;
}

.btn-delete:hover {
    color: #c0392b;
}

/* Meme View Page */
.loading-state, .error-state {
    text-align: center;
    padding: 60px 20px;
    margin: 40px;
}

.error-state h2 {
    color: #e74c3c;
    margin-bottom: 15px;
}

.meme-view {
    padding: 30px;
}

.meme-display {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.meme-container-large {
    position: relative;
    width: 600px;
    max-width: 100%;
    aspect-ratio: 1;
    border: 2px solid #ddd;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f0f0f0;
}

.meme-details {
    max-width: 600px;
    margin: 0 auto;
}

.detail-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
}

.detail-item strong {
    color: #333;
}

.share-section {
    margin: 25px 0;
    padding: 20px;
    background: #e8f5e9;
    border-radius: 4px;
}

.share-section h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

.share-link-box {
    display: flex;
    gap: 10px;
}

.share-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    font-family: monospace;
    background: white;
}

.report-section {
    margin: 25px 0;
    padding: 20px;
    background: #fff3cd;
    border-radius: 4px;
    border-left: 4px solid #ffc107;
    text-align: center;
}

.report-section p {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

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

.btn-danger:hover {
    background: #c0392b;
}

.report-success {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    text-align: center;
}

.actions {
    margin-top: 20px;
    text-align: center;
}

/* Admin Panel */
.admin-panel {
    padding: 30px;
}

.admin-section {
    margin-bottom: 30px;
}

.admin-section h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.reports-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.report-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.report-date {
    color: #999;
    font-size: 13px;
}

.report-reason {
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 4px;
    font-size: 14px;
}

.report-meme {
    background: white;
    padding: 15px;
    border-radius: 4px;
}

.report-meme h4 {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
}

.report-meme-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    font-size: 13px;
    color: #666;
}

/* Responsive */
@media (max-width: 1024px) {
    .meme-creator {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .memes-grid {
        grid-template-columns: 1fr;
    }
    
    .meme-creator {
        padding: 20px;
    }
    
    .meme-text {
        font-size: 24px;
    }
}