:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --gray-color: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

.dark {
    --light-color: #1e293b;
    --dark-color: #f8fafc;
    --gray-color: #94a3b8;
    --border-color: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left:20px;
}

.logo i {
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.5rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding-right: 20px;
}

.nav-link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.dark-mode-form {
    margin: 0;
}

.dark-mode-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Main Content */
.main {
    flex: 1;
    padding: 2rem 0;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.hero p {
    font-size: 1.2rem;
    color: var(--gray-color);
    max-width: 800px;
    margin: 0 auto;
}

/* Forms */
.url-form-container, .edit-form-container, 
.stats-form-container, .qrcode-container {
    max-width: 800px;
    margin: 0 auto 3rem;
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.url-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group input {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    background-color: var(--light-color);
    color: var(--dark-color);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    font-size: 0.875rem;
    color: var(--gray-color);
}

.submit-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: var(--primary-dark);
}

/* Results */
.result {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: var(--radius);
    border-left: 4px solid;
}

.result.success {
    background-color: rgba(16, 185, 129, 0.1);
    border-left-color: var(--secondary-color);
}

.result.error {
    background-color: rgba(239, 68, 68, 0.1);
    border-left-color: var(--danger-color);
}

.result.info {
    background-color: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
}

.result h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.result-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.result-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.url-display {
    display: flex;
    gap: 0.5rem;
}

.url-display input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--light-color);
    color: var(--dark-color);
}

.copy-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s;
}

.copy-btn:hover {
    background-color: #0da271;
}

/* Stats */
.stats-container {
    max-width: 800px;
    margin: 0 auto;
}

.stats-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background-color: var(--dark-color);
    color: var(--light-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-icon {
    background-color: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 1rem;
    color: var(--gray-color);
    margin-bottom: 0.25rem;
}

.stat-info p {
    font-size: 1.25rem;
    font-weight: 600;
}

.stat-number {
    color: var(--primary-color);
    font-size: 2rem !important;
}

.long-url {
    word-break: break-all;
    font-size: 0.9rem !important;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.action-btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.action-btn {
    background-color: var(--primary-color);
    color: white;
}

.action-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.action-btn.secondary {
    background-color: var(--gray-color);
}

.action-btn.secondary:hover {
    background-color: #475569;
}

/* QR Code */
.qrcode-result {
    margin-top: 2rem;
    padding: 2rem;
    background-color: var(--dark-color);
    color: var(--light-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.qrcode-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

.qrcode-preview img {
    max-width: 300px;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.qrcode-info {
    width: 100%;
}

.qrcode-info p {
    margin-bottom: 0.5rem;
}

.qrcode-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.qrcode-tips {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius);
    border-left: 4px solid #3b82f6;
}

.qrcode-tips h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.qrcode-tips ul {
    padding-left: 1.5rem;
}

.qrcode-tips li {
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 2rem 0 0;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    padding-left: 20px;
}

.footer-column h3 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
}

.footer-column p, .footer-column li {
    color: var(--gray-color);
    margin-bottom: 0.5rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column a {
    color: var(--gray-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s;
}

.footer-column a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--gray-color);
    font-size: 0.875rem;
}

/* Recent URL */
.recent-url {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1.5rem;
    background-color: var(--dark-color);
    color: var(--light-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.recent-url h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.recent-url p {
    margin-bottom: 0.5rem;
}

.recent-url a {
    color: var(--primary-color);
    text-decoration: none;
}

.recent-url a:hover {
    text-decoration: underline;
}

/* Edit Info */
.edit-info {
    background-color: rgba(59, 130, 246, 0.1);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid #3b82f6;
}

.edit-info p {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-text {
    font-size: 0.9rem;
    color: var(--gray-color);
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius);
}

/* Stats Info */
.stats-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius);
    border-left: 4px solid #3b82f6;
}

.stats-info h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stats-info ol {
    padding-left: 1.5rem;
}

.stats-info li {
    margin-bottom: 0.5rem;
}

code {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        justify-content: center;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .qrcode-preview {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .url-display {
        flex-direction: column;
    }
    
    .copy-btn {
        justify-content: center;
    }
}

/* QR Code Styling */
#qrcodeContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 256px;
    min-width: 256px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px;
    margin-bottom: 1rem;
}

#qrcodeContainer canvas,
#qrcodeContainer img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.qrcode-result {
    margin-top: 2rem;
    padding: 2rem;
    background-color: var(--dark-color);
    color: var(--light-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: none; /* Hidden by default */
}

.qrcode-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .qrcode-preview {
        flex-direction: row;
        align-items: flex-start;
    }
}

.qrcode-info {
    flex: 1;
    width: 100%;
}

.qrcode-info p {
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.qrcode-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.qrcode-info a:hover {
    text-decoration: underline;
}

.qrcode-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.qrcode-actions .action-btn {
    flex: 1;
    min-width: 150px;
    justify-content: center;
}

.qrcode-tips {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius);
    border-left: 4px solid #3b82f6;
}

.qrcode-tips h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.qrcode-tips ul {
    padding-left: 1.5rem;
}

.qrcode-tips li {
    margin-bottom: 0.5rem;
}

/* Loading animation */
.qr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.qr-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}