
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #fafbfc;
    --text-primary: #333333;
    --text-secondary: #555555;
    --text-tertiary: #666666;
    --text-muted: #999999;
    --border-color: #e1e5e9;
    --border-light: #d1d5db;
    --checkbox-checked: #999999;
    --shadow-light: rgba(0,0,0,0.1);
    --shadow-medium: rgba(0,0,0,0.15);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #7944ae 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #252525;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-tertiary: #cccccc;
    --text-muted: #888888;
    --border-color: #404040;
    --border-light: #505050;
    --checkbox-checked: #404040;
    --shadow-light: rgba(0,0,0,0.3);
    --shadow-medium: rgba(0,0,0,0.4);
    --gradient-primary: linear-gradient(135deg, #5623a5 0%, #1e1a51 100%);
    --gradient-secondary: linear-gradient(135deg, #70260c 0%, #bb1c1c 100%);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gradient-primary);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    transition: all 0.3s ease;
}

/* Dark Mode Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px var(--shadow-light);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow-medium);
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    transition: all 0.3s ease;
}

.theme-toggle .sun-icon {
    display: block;
    color: #f59e0b;
}

.theme-toggle .moon-icon {
    display: none;
    color: #6366f1;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

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

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
    margin-bottom: 30px;
    font-weight: 400;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    margin-bottom: 40px;
}

.create-section {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px var(--shadow-light);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

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

.donation-card {
    background: var(--bg-primary);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 25px var(--shadow-light);
    text-align: center;
    transition: all 0.3s ease;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    background: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.image-upload {
    position: relative;
    border: 2px dashed var(--border-light);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.image-upload:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
}

.image-upload input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    top: 0;
    left: 0;
}

.image-preview {
    max-width: 100%;
    max-height: 250px;
    border-radius: 10px;
    margin-top: 15px;
    box-shadow: 0 4px 12px var(--shadow-light);
}

.btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gradient-secondary);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loading {
    display: inline;
}

.page-list {
    margin-top: 40px;
}

.page-item {
    background: var(--bg-primary);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 15px;
    box-shadow: 0 8px 20px var(--shadow-light);
    transition: all 0.3s ease;
    animation: slideIn 0.5s ease;
}

.page-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px var(--shadow-medium);
}

.page-url {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    display: block;
    margin-bottom: 8px;
}

.page-url:hover {
    text-decoration: underline;
}

.page-message {
    margin: 10px 0;
    color: var(--text-tertiary);
    line-height: 1.6;
}

.page-expires {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.stats-card {
    background: var(--gradient-secondary);
    color: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(240, 147, 251, 0.3);
}

.stats-number {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.stats-label {
    opacity: 0.9;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Page View Styles */
.page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.page-content {
    background: var(--bg-primary);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px var(--shadow-light);
    transition: all 0.3s ease;
}

.page-header {
    background: var(--gradient-primary);
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.back-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.back-link:hover {
    opacity: 1;
}

.page-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    opacity: 0.9;
}

.page-article {
    padding: 40px;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 30px;
    line-height: 1.2;
}

.page-image {
    margin: 30px 0;
    text-align: center;
}

.page-image img {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-light);
}

.page-message {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 40px;
    white-space: pre-wrap;
}

.page-message ul {
    margin-left: 30px
}

.page-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.share-section h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

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

.share-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-secondary);
}

.share-btn:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-primary);
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    transition: all 0.3s ease;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

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

/* Error Pages */
.error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    color: white;
}

.error-content {
    max-width: 500px;
    padding: 40px;
}

.error-title {
    font-size: 6rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.error-subtitle {
    font-size: 2rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.error-message {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 80px;
    background: #10b981;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    z-index: 1001;
    animation: slideInRight 0.3s ease;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .logo {
        font-size: 2rem;
    }

    .container {
        padding: 15px;
    }

    .create-section {
        padding: 30px 20px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-article {
        padding: 30px 20px;
    }

    .page-title {
        font-size: 2rem;
    }

    .page-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .error-title {
        font-size: 4rem;
    }

    .error-actions {
        flex-direction: column;
    }

    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .notification {
        right: 70px;
        top: 15px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px 0;
    }

    .logo {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .share-buttons {
        justify-content: center;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

@media print {
    body {
        background: white;
        color: black;
    }

    .page-header,
    .page-footer,
    .btn,
    .share-section,
    .theme-toggle {
        display: none;
    }

    .page-container {
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .page-content {
        box-shadow: none;
        border-radius: 0;
    }
}

.character-counter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}

.character-counter span:first-child {
    font-weight: 500;
}

.counter-note {
    opacity: 0.7;
    font-size: 11px;
    display: none;
}

.character-counter.error {
    color: #ef4444;
}

.character-counter.error .counter-note {
    display: block;
}

.form-group input.invalid,
.form-group textarea.invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.checkbox-container {
    display: block;
    position: relative;
    padding-left: 35px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 16px;
    user-select: none;
    color: var(--text-primary);
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 23px;
    width: 23px;
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: var(--bg-primary);
    border-color: var(--border-color);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--checkbox-checked);
    border-color: var(--checkbox-checked);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
