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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    color: #e4e4e7;
    min-height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 16px 24px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.nav-link.current {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.nav-separator {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.tool-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
}

.tool-title i {
    font-size: 28px;
}

.tool-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.action-btn.active {
    background: rgba(255, 255, 255, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px 24px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

/* Sections */
.section-header {
    text-align: center;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.section-header h2 i {
    color: #a78bfa;
}

.section-header p {
    color: #a1a1aa;
    font-size: 16px;
}

/* Form Styles */
.create-form {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 32px;
    backdrop-filter: blur(20px);
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #e4e4e7;
    margin-bottom: 10px;
    font-size: 14px;
}

.form-group label i {
    color: #a78bfa;
    width: 16px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input[type="datetime-local"],
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #71717a;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.help-text {
    display: block;
    font-size: 12px;
    color: #71717a;
    margin-top: 6px;
}

.char-counter {
    display: block;
    text-align: right;
    font-size: 12px;
    color: #71717a;
    margin-top: 4px;
}

/* Slug Input */
.slug-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.slug-input-wrapper:focus-within {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

.slug-prefix {
    padding: 14px 12px;
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.slug-input-wrapper input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding-left: 8px;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Checkbox */
.checkbox-group {
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.3);
}

.checkbox-label input:checked + .checkmark {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

.checkbox-label input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.submit-btn:active {
    transform: translateY(0);
}

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

/* Error Result */
.error-result {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    margin-top: 24px;
}

.error-icon {
    font-size: 48px;
    color: #ef4444;
    margin-bottom: 16px;
}

.error-result h3 {
    font-size: 20px;
    color: #ef4444;
    margin-bottom: 16px;
}

.error-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
}

.error-list li {
    color: #fca5a5;
    padding: 8px 0;
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-list li:last-child {
    border-bottom: none;
}

.error-list li::before {
    content: '•';
    color: #ef4444;
    font-weight: bold;
}

.dismiss-btn {
    padding: 12px 24px;
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #fca5a5;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.dismiss-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fff;
}

/* Success Result */
.success-result {
    background: rgba(34, 197, 94, 0.1);
    border: 2px solid rgba(34, 197, 94, 0.3);
    border-radius: 20px;
    padding: 40px 32px;
    text-align: center;
}

.success-icon {
    font-size: 60px;
    color: #22c55e;
    margin-bottom: 20px;
}

.success-result h3 {
    font-size: 24px;
    color: #22c55e;
    margin-bottom: 24px;
}

.created-link-box {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.created-link-box input {
    flex: 1;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    color: #22c55e;
    font-size: 15px;
    font-family: monospace;
}

.copy-btn {
    padding: 14px 20px;
    background: #22c55e;
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #16a34a;
    transform: scale(1.05);
}

.link-actions {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.action-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #a78bfa;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.action-link:hover {
    background: rgba(167, 139, 250, 0.1);
    color: #c4b5fd;
}

/* My Links Section */
.my-links-section {
    margin-top: 40px;
}

.links-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0 16px;
}

.search-box i {
    color: #71717a;
}

.search-box input {
    flex: 1;
    padding: 12px 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 15px;
}

.search-box input:focus {
    outline: none;
}

.refresh-btn {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #a1a1aa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Links Container */
.links-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px;
    color: #71717a;
}

.loading-spinner i {
    font-size: 32px;
    color: #8b5cf6;
}

.no-links {
    text-align: center;
    padding: 60px 20px;
    color: #71717a;
}

.no-links i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Link Card */
.link-card {
    background: rgba(30, 30, 50, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
}

.link-card:hover {
    background: rgba(40, 40, 65, 0.95);
    border-color: rgba(139, 92, 246, 0.5);
}

.link-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.link-url {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    word-break: break-all;
}

.link-url i {
    color: #8b5cf6;
}

.link-url a {
    color: #e4e4e7;
    text-decoration: none;
}

.link-url a:hover {
    color: #fff;
    text-decoration: underline;
}

.link-card-actions {
    display: flex;
    gap: 8px;
}

.link-card-actions button {
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: #a1a1aa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.link-card-actions button:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.link-card-actions button.view-link-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #8b5cf6;
}

.link-card-actions button.delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.link-destination {
    font-size: 13px;
    color: #a1a1aa;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.link-destination i {
    color: #6366f1;
}

.link-destination a {
    color: #a1a1aa;
    text-decoration: none;
}

.link-destination a:hover {
    color: #e4e4e7;
    text-decoration: underline;
}

.link-message {
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid #6366f1;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    color: #d4d4d8;
    margin-bottom: 12px;
    line-height: 1.5;
}

.link-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: #a1a1aa;
}

.link-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.link-stat i {
    color: #8b5cf6;
}

.link-expired {
    opacity: 0.6;
    border-color: rgba(239, 68, 68, 0.3);
}

.expired-badge {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #1f1f2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    background: rgba(239, 68, 68, 0.1);
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ef4444;
    font-size: 18px;
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    margin-bottom: 12px;
    color: #a1a1aa;
}

.link-to-delete {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    font-family: monospace;
    color: #ef4444;
    word-break: break-all;
}

.warning-text {
    color: #f97316 !important;
    font-size: 13px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    background: rgba(0, 0, 0, 0.2);
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #a1a1aa;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 12px;
    }

    .header-nav {
        order: 1;
    }

    .nav-link span {
        display: none;
    }

    .nav-link {
        padding: 8px 10px;
    }

    .tool-title {
        font-size: 18px;
        order: 2;
        flex: 1;
        justify-content: center;
    }

    .back-btn {
        order: 1;
        padding: 8px 12px;
    }

    .back-btn span {
        display: none;
    }

    .tool-actions {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .main-content {
        padding: 24px 16px;
    }

    .create-form {
        padding: 24px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .slug-prefix {
        font-size: 12px;
        padding: 12px 10px;
    }

    .section-header h2 {
        font-size: 22px;
    }

    .link-card {
        padding: 16px;
    }

    .link-stats {
        flex-wrap: wrap;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .tool-title {
        font-size: 16px;
    }

    .tool-title i {
        display: none;
    }

    .create-form {
        padding: 20px 16px;
    }

    .section-header h2 {
        font-size: 20px;
    }

    .section-header p {
        font-size: 14px;
    }

    .submit-btn {
        padding: 14px 20px;
        font-size: 15px;
    }

    .created-link-box {
        flex-direction: column;
    }

    .copy-btn {
        width: 100%;
    }

    .link-actions {
        flex-direction: column;
        gap: 12px;
    }
}
